Skip to content

Instantly share code, notes, and snippets.

@tadeuzagallo
Created January 14, 2015 18:43
Show Gist options
  • 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