Skip to content

Instantly share code, notes, and snippets.

@john1jan
Last active March 20, 2017 12:47
Show Gist options
  • Save john1jan/1705694274d7e6dcda09cbbffb01d5e2 to your computer and use it in GitHub Desktop.
Save john1jan/1705694274d7e6dcda09cbbffb01d5e2 to your computer and use it in GitHub Desktop.
Binding Method using React.createClass
var Sample = React.createClass({
getInitialState() {
return { message: 'Hello world' };
},
print() {
console.log(this.state.message);
},
render() {
return (
<input type="button" value="Print" onClick={this.print} />
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment