Skip to content

Instantly share code, notes, and snippets.

@abelsan
Created December 8, 2020 20:15
Show Gist options
  • Save abelsan/2655e2cdd864384694e4de43c1eb383c to your computer and use it in GitHub Desktop.
Save abelsan/2655e2cdd864384694e4de43c1eb383c to your computer and use it in GitHub Desktop.
Standalone html file React.JS template
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Template</title>
<!-- don't use this in production: -->
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
</head>
<body>
<h1>Template</h1>
<!-- we will put our teact component inside this div -->
<div id="root"></div>
<!-- load react -->
<script src="https://unpkg.com/react/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom/umd/react-dom.development.js" crossorigin></script>
<!-- load our react component. -->
<script src="index.js" defer type="text/babel"></script>
</body>
</html>
ReactDOM.render(
<h1>Hello World!</h1>,
document.getElementById('root')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment