Last active
March 20, 2017 13:11
-
-
Save john1jan/740aedd2f60c42185a32fb598945cf69 to your computer and use it in GitHub Desktop.
BindingSample2
This file contains 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); | |
}, | |
printMars(message) { | |
console.log("Hello " + message); | |
}, | |
render() { | |
return ( | |
<div> | |
<input type="button" value="Print World" onClick={this.print} /> | |
<input type="button" value="Print Mars" onClick={this.printMars.bind(this, "Mars")} /> | |
</div> | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment