Created
May 22, 2017 12:21
-
-
Save hamlim/867071f0f0e426d4c142d6017a805424 to your computer and use it in GitHub Desktop.
Curried function Event Handlers in React
This file contains 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
class Comp extends Component { | |
handleClick = (...args) => e => { | |
console.log(args, e); | |
} | |
render() { | |
return <button onClick={this.handleClick('args')}>Click Me</button>; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment