score:0

Accepted answer
class Demo extends Component {

    //suppose you have a list something like this

    state = { 
        owners:[{"name" :" owners1"}, { "name": "owners2"}, { "name" : "owners3"},{ "name" : "owners4"}]

     }
    render() { 
        return ( 
            <div >
            { this.state.owners.map((it) => 
               ( <li><a href="#">{it.name}</a></li>)
            )}
            </div>
         );
    }
}
 
export default Demo;

score:0

In React you can add a simple onClick-Attribute like that:

<li onClick={function () {

alert(owners.locationOwner);

}} > {owners.nameOwner}</li>

It is basically onClick={} that takes in a function. This function is called when the onClick-Event happens.

React Docs


Related Query

More Query from same tag