Created
October 22, 2016 16:46
-
-
Save dpickett/3cc982d0069b9a38dcf46be3c13fab1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let React = require('react') | |
let ReactDOM = require('react-dom') | |
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