re: How to pass extra params to your handlers functions with React? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Is this a good case for some event delegation? Perhaps assigning a click handler to the parent which should be able to give you all the children if...
 

You mean somenthing like this?yeah a could add it in the article. thanks

class MyLi extends PureComponent {
_onPress = (evt) => {
const { item, onPress } = this.props;
onPress(evt, item);
}
render() {
return <li onClick={this._onPress}>{this.props.children}</li>
}
}
code of conduct - report abuse