Skip to content

Instantly share code, notes, and snippets.

@puppybits
Created January 7, 2016 18:34
Show Gist options
  • Save puppybits/f76c1408a74d79440c12 to your computer and use it in GitHub Desktop.
Save puppybits/f76c1408a74d79440c12 to your computer and use it in GitHub Desktop.
A React Hello World without JSX, ES6, transpiling, tooling or anything getting in the way
<html>
<body>
<div id="app"></div>
<script src="//fb.me/react-0.14.3.js"></script>
<script src="//fb.me/react-dom-0.14.3.js"></script>
<script>
var el = React.createElement;
var myView = React.createClass({
render: function(){
return el('h1', {color:'#F00'}, "Hello React");
}
});
ReactDOM.render(el(myView), document.getElementById('app'));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment