Created
September 5, 2016 22:49
-
-
Save anonymous/c84bd34cbd01673aab0dd5f3a685195c to your computer and use it in GitHub Desktop.
// source http://jsbin.com
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> | |
<meta charset="utf-8"> | |
<title>React</title> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css"> | |
<script src="http://fb.me/react-with-addons-15.1.0.js"></script> | |
<script src="http://fb.me/react-dom-15.1.0.js"></script> | |
<style id="jsbin-css"> | |
body { | |
margin: 20px; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="container"></div> | |
<script id="jsbin-javascript"> | |
var Hello = React.createClass({displayName: 'Hello', | |
propTypes: { | |
name: React.PropTypes.oneOfType([ | |
React.PropTypes.bool, | |
React.PropTypes.number, | |
]).isRequired | |
}, | |
render: function() { | |
return ( | |
React.createElement("div", null, | |
React.createElement("h1", null, "Welcome to React"), | |
React.createElement("div", null, "Hello ", this.props.name) | |
) | |
); | |
} | |
}); | |
ReactDOM.render( | |
React.createElement(Hello, {name: "World"}), | |
document.getElementById('container') | |
); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React</title> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css"> | |
<script src="//fb.me/react-with-addons-15.1.0.js"><\/script> | |
<script src="//fb.me/react-dom-15.1.0.js"><\/script> | |
</head> | |
<body> | |
<div id="container"></div> | |
</body> | |
</html> | |
</script> | |
<script id="jsbin-source-css" type="text/css">body { | |
margin: 20px; | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var Hello = React.createClass({ | |
propTypes: { | |
name: React.PropTypes.oneOfType([ | |
React.PropTypes.bool, | |
React.PropTypes.number, | |
]).isRequired | |
}, | |
render: function() { | |
return ( | |
<div> | |
<h1>Welcome to React</h1> | |
<div>Hello {this.props.name}</div> | |
</div> | |
); | |
} | |
}); | |
ReactDOM.render( | |
<Hello name="World" />, | |
document.getElementById('container') | |
); | |
</script></body> | |
</html> |
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
body { | |
margin: 20px; | |
} |
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
var Hello = React.createClass({displayName: 'Hello', | |
propTypes: { | |
name: React.PropTypes.oneOfType([ | |
React.PropTypes.bool, | |
React.PropTypes.number, | |
]).isRequired | |
}, | |
render: function() { | |
return ( | |
React.createElement("div", null, | |
React.createElement("h1", null, "Welcome to React"), | |
React.createElement("div", null, "Hello ", this.props.name) | |
) | |
); | |
} | |
}); | |
ReactDOM.render( | |
React.createElement(Hello, {name: "World"}), | |
document.getElementById('container') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment