Created
November 28, 2020 12:25
-
-
Save Takeno/14ee2eb918448798eaead3b5b820b009 to your computer and use it in GitHub Desktop.
Single-file-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" /> | |
<title>Add React in One Minute</title> | |
</head> | |
<body> | |
<!-- We will put our React component inside this div. --> | |
<div id="root"></div> | |
<!-- Load React. --> | |
<!-- Note: when deploying, replace "development.js" with "production.min.js". --> | |
<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script> | |
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script> | |
<script> | |
const myApp = React.createElement( | |
"h1", {id: "h"}, "Hello, world!" | |
); | |
const container = document.getElementById("root"); | |
ReactDOM.render(myApp, container); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment