-
-
Save mrlevitas/a44621be43d74da4db5825422fba7789 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