Skip to content

Instantly share code, notes, and snippets.

@bobbyjam99-zz
Created June 1, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobbyjam99-zz/12a7a1f45021c86da581 to your computer and use it in GitHub Desktop.
Save bobbyjam99-zz/12a7a1f45021c86da581 to your computer and use it in GitHub Desktop.
<!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