1render(){
2 return(
3 <ul id="todo">
4 {this.state.items.map((item,i) =>
5 <li className='list-group-item' key={i} data-id={item.id}>{item.name}
6 <button onClick={() => this.yourfunc(item.id)}>X</button>
7 </li>
8 )}
9 </ul>
10 )
11}
12