Skip to content

Instantly share code, notes, and snippets.

@dpickett
Created October 22, 2016 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dpickett/1e191cb628f252ca2a1a9336ab14ac90 to your computer and use it in GitHub Desktop.
Save dpickett/1e191cb628f252ca2a1a9336ab14ac90 to your computer and use it in GitHub Desktop.
var Hello = React.createClass({
getInitialState: function(){
return {
}
},
updateName: function(event){
this.setState({
name: event.target.value
})
},
render: function() {
return (
<div>
<input type="text"
onChange={this.updateName}/>
<strong>Hello</strong> {this.state.name}
</div>
)
}
});
ReactDOM.render(
<div>
<Hello name="World" />
</div>,
document.getElementById('container')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment