Created
November 5, 2018 10:59
-
-
Save jackinf/8fd4a2fba480c292a6235f021e00fe4e to your computer and use it in GitHub Desktop.
React hello world in 1 file - simplest example.
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
<html> | |
<head> | |
<script src="https://unpkg.com/react@15/dist/react.min.js"> </script><script src="https://unpkg.com/react-dom@15/dist/react-dom.min.js"> | |
</script> | |
<script src="https://unpkg.com/[email protected]/babel.min.js"></script> | |
</head> | |
<body> | |
<div id="root"></div> | |
<script type="text/babel"> | |
class Hello extends React.Component { | |
render() { | |
return <h1>Hello world!</h1>; | |
} | |
} | |
ReactDOM.render( | |
<Hello />, | |
document.getElementById("root") | |
); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment