Created
June 18, 2016 06:46
-
-
Save Zapix/bddfa20ba5e4468fd6d786ed01abfbf9 to your computer and use it in GitHub Desktop.
func bindings react
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 SomeComponent extends React.Component { | |
| static propTypes = { | |
| action: PropTypes.func, | |
| } | |
| handleSubmit() { | |
| const { action } = this.props; | |
| action(); | |
| } | |
| render() { | |
| return ( | |
| <form onSubmit={::this.handleSubmit}> | |
| <button type="submit">Submit</button> | |
| </form> | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment