Last active
March 31, 2016 15:34
-
-
Save dennishall1/898ed60c1b76112c139006d0c1d39788 to your computer and use it in GitHub Desktop.
A Simple Example, in Context
This file contains hidden or 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> | |
<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