Skip to content

Instantly share code, notes, and snippets.

@shotaK
Last active November 23, 2016 20:48
Show Gist options
  • Save shotaK/59f286f597a5a3dfc01c77c4e43b2a02 to your computer and use it in GitHub Desktop.
Save shotaK/59f286f597a5a3dfc01c77c4e43b2a02 to your computer and use it in GitHub Desktop.
Redux - avoiding binding functions in constructor.
class MyComponent extends Component {
handleClick = (args) => (event) => {
// access args here;
// handle the click event
}
render() {
return (
<div onClick={this.handleClick(args)}>
.....
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment