Last active
March 20, 2017 12:47
-
-
Save john1jan/1705694274d7e6dcda09cbbffb01d5e2 to your computer and use it in GitHub Desktop.
Binding Method using React.createClass
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
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