Skip to content

Instantly share code, notes, and snippets.

@mrlevitas
Forked from dpickett/simple-widget.js
Created October 22, 2016 16:35
Show Gist options
  • Save mrlevitas/a44621be43d74da4db5825422fba7789 to your computer and use it in GitHub Desktop.
Save mrlevitas/a44621be43d74da4db5825422fba7789 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