Last active
November 23, 2016 20:48
-
-
Save shotaK/59f286f597a5a3dfc01c77c4e43b2a02 to your computer and use it in GitHub Desktop.
Redux - avoiding binding functions in constructor.
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
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