Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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')
- );
Add Comment
Please, Sign In to add comment