Created
August 11, 2017 15:57
-
-
Save sanketmeghani/d8636c9f3f619ee3190c16d7162eb479 to your computer and use it in GitHub Desktop.
React event handler with parameters using property initializer syntax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleClick = (param) => (e) => { | |
console.log('Event', e); | |
console.log('Parameter', param); | |
} | |
render() { | |
<button onClick={this.handleClick('Parameter')}></button> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment