score:4

Accepted answer

it's pretty easy to do that you just need to add onclick handler to the renderitem section.

renderitem = {(item, index) => (
  <list.item key={item} onclick={() => this.handleclick(index)}>
    <list.item.meta
      avatar={
        <avatar src="https://zos.alipayobjects.com/rmsportal/odtlcjxafvqbxhnvxcyx.png" />
      }
      title={<a href="#">{item}</a>}
    />
  </list.item>
)}

and for the handleclick function the code will be:

handleclick = index => {
  const selecteditem = this.state.data[index];
}

selecteditem is the one you are looking for

score:1

the above solution should work. but just ensure that you are attaching onclick event to a dom element. if it is a custom component then event handlers won't work. so, in this case list.item (i guess that it is a custom component) needs to access onclick as a prop and attach this event to its top most dom element like the follwing:

// list.item

<li onclick={this.props.onclick} />

Related Query

More Query from same tag