Created
January 24, 2018 19:07
-
-
Save ivanalejandro0/7b706fe216c62baf66a26ffdc1be5b68 to your computer and use it in GitHub Desktop.
React single page example
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>Hello World</title> | |
<script src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/[email protected]/babel.min.js"></script> | |
</head> | |
<body> | |
<div id="root"></div> | |
<script type="text/babel"> | |
ReactDOM.render( | |
<h1>Hello, world!</h1>, | |
document.getElementById('root') | |
); | |
</script> | |
<!-- | |
Note: this page is a great way to try React but it's not suitable for production. | |
It slowly compiles JSX with Babel in the browser and uses a large development build of React. | |
To set up a production-ready React build environment, follow these instructions: | |
* https://reactjs.org/docs/add-react-to-a-new-app.html | |
* https://reactjs.org/docs/add-react-to-an-existing-app.html | |
You can also use React without JSX, in which case you can remove Babel: | |
* https://reactjs.org/docs/react-without-jsx.html | |
* https://reactjs.org/docs/cdn-links.html | |
--> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From: https://github.com/reactjs/reactjs.org/blob/master/static/html/single-file-example.html
This can be previewed using https://rawgit.com/
Example development link: https://rawgit.com/reactjs/reactjs.org/master/static/html/single-file-example.html