class Table extends Component {
constructor(props) {
super(props);
this.handleClick = handleClick.bind(this);
}
handleClick(e) {
console.log(e.target);
}
render() {
return(<div onClick={this.handleClick}></div>);
}
}
class Table extends Component {
constructor(props) {
super(props);
this.handleClick = handleClick.bind(this);
}
handleClick(id) {
console.log(id);
}
render() {
return (
<div>
{items.map(item => <Item key={item.id} onClick={() => this.handleClick(item.id)} />)}
</div>);
}
}