title: pass id through on click react.js
body: <p>Below is my partial code but my question is very simple, how can I get says data-id="1" to my function when user clicked on the <code>li</code>?</p>
  
  <pre><code>render(){
      return(
        &lt;ul id="todo"&gt;
        {this.state.items.map((item,i) =&gt; 
          &lt;li className='list-group-item' key={i} data-id={item.id}&gt;{item.name}
          &lt;button onClick={//how to pass item.id to my function?}&gt;X&lt;/button&gt;
          &lt;/li&gt;
        )}
        &lt;/ul&gt;
      ) 
    }
  </code></pre>