Created
December 27, 2016 08:56
-
-
Save ayoisaiah/bfc141dd4d78c053bc63f7e8ce6eb10c to your computer and use it in GitHub Desktop.
Hello World in React!
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"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Hello World!</title> | |
</head> | |
<body> | |
<main id="app"> | |
</main> | |
<!-- React --> | |
<script src="https://fb.me/react-15.1.0.js"></script> | |
<script src="https://fb.me/react-dom-15.1.0.js"></script> | |
<!-- Babel --> | |
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> | |
<!-- Your code --> | |
<script type="text/babel"> | |
var HelloWorld = React.createClass({ | |
render: function () { | |
return ( | |
<h1>Hello World!</h1> | |
); | |
} | |
}); | |
//Renders our component output inside our `main` element with the id of "app" | |
ReactDOM.render( | |
<HelloWorld />, document.getElementById("app") | |
); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment