Skip to content

Instantly share code, notes, and snippets.

@nbhartiya
Created August 4, 2015 01:23
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 nbhartiya/e33ab1194f358eaa3d11 to your computer and use it in GitHub Desktop.
Save nbhartiya/e33ab1194f358eaa3d11 to your computer and use it in GitHub Desktop.
How ReactJS bindings used to work
var NoLink = React.createClass({
getInitialState: function() {
return {message: 'Hello!'};
},
handleChange: function(event) {
this.setState({message: event.target.value});
},
render: function() {
var message = this.state.message;
return <input type="text" value={message} onChange={this.handleChange} />;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment