Created
June 1, 2015 14:09
-
-
Save bobbyjam99-zz/12a7a1f45021c86da581 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="build/react.js"></script> | |
<script src="build/JSXTransformer.js"></script> | |
</head> | |
<body> | |
<div id="app-container"></div> | |
<script type="text/jsx"> | |
var App = React.createClass({ | |
getInitialState: function() { | |
return { message: "" }; | |
}, | |
updateMessage: function(e) { | |
this.setState({ message: e.target.value }); | |
}, | |
render: function() { | |
return ( | |
<div> | |
<input type="text" onChange={this.updateMessage} /> | |
<p>{this.state.message}</p> | |
</div> | |
); | |
} | |
}); | |
React.render( | |
<App />, | |
document.getElementById('app-container') | |
); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment