Skip to content

Instantly share code, notes, and snippets.

@Zapix
Created June 18, 2016 06:46
Show Gist options
  • Select an option

  • Save Zapix/bddfa20ba5e4468fd6d786ed01abfbf9 to your computer and use it in GitHub Desktop.

Select an option

Save Zapix/bddfa20ba5e4468fd6d786ed01abfbf9 to your computer and use it in GitHub Desktop.
func bindings react
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