Created
October 22, 2016 15:37
-
-
Save dpickett/1e191cb628f252ca2a1a9336ab14ac90 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
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