handleClick = i => this.setState({ justClicked: i })
render () {
return (
<div>
Just clicked: {this.state.justClicked}
<ul>
{ this.state.items.map(i =>
<lionClick={()=> this.handleClick(i)}>
Item: {i}
</li>
) }
</ul>
</div>
)
}
}
```
#### Example: Passing params using data-attributes
Alternately, you can use DOM APIs to store data needed for event handlers. Consider this approach if you need to optimize a large number of elements or have a render tree that relies on React.PureComponent equality checks.