Skip to content

Instantly share code, notes, and snippets.

@tadeuzagallo
Created January 14, 2015 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadeuzagallo/ee4f46d9900e4ce66e27 to your computer and use it in GitHub Desktop.
Save tadeuzagallo/ee4f46d9900e4ce66e27 to your computer and use it in GitHub Desktop.
React binding
React.createClass({
update: function() {
this.setState({ lastUpdated: Date.now() });
},
render: function () {
return <button onClick={ this.update() }>Update!</button>
}
})
React.createClass({
update: function() {
this.setState({ lastUpdated: Date.now() });
},
render: function () {
return <button onClick={ this.update }>Update!</button>
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment