DEV Community

Discussion on: How to pass extra params to your handlers functions with React?

Collapse
 
eatsjobs profile image
Pasquale Mangialavori • Edited

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>
}
}