Created
March 25, 2016 19:17
-
-
Save jgraham909/cb2fda74fc9ccbaaf330 to your computer and use it in GitHub Desktop.
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.7.js"></script> | |
<script src="https://fb.me/react-dom-0.14.7.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"> | |
var HelloWorld = React.createClass({ | |
render: function() { | |
return ( | |
<p> | |
Hello, <input type="text" placeholder="Your name here" />! | |
It is {this.props.date.toTimeString()} | |
</p> | |
); | |
} | |
}); | |
setInterval(function() { | |
ReactDOM.render( | |
<HelloWorld date={new Date()} />, | |
document.getElementById('example') | |
); | |
}, 500); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Taken from https://facebook.github.io/react/docs/displaying-data.html