Skip to content

Instantly share code, notes, and snippets.

@dennishall1
Last active March 31, 2016 15:34
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 dennishall1/898ed60c1b76112c139006d0c1d39788 to your computer and use it in GitHub Desktop.
Save dennishall1/898ed60c1b76112c139006d0c1d39788 to your computer and use it in GitHub Desktop.
A Simple Example, in Context
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello React</title>
<script src="https://fb.me/react-0.14.8.js"></script>
<script src="https://fb.me/react-dom-0.14.8.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/babel">
// normally, this would be in an external file, HelloMessage.js
var HelloMessage = React.createClass({
render: function() {
return <div>{this.props.greeting}, {this.props.subject}</div>;
}
});
</script>
<script type="text/babel">
ReactDOM.render(
React.createElement(HelloWorld, { greeting: "Hello", subject: "World" }),
document.getElementById('example')
);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment