Skip to content

Instantly share code, notes, and snippets.

@hcz
Created May 5, 2021 20:23
Show Gist options
  • Select an option

  • Save hcz/bac27d1eb035e6586044a86ea2c02a8f to your computer and use it in GitHub Desktop.

Select an option

Save hcz/bac27d1eb035e6586044a86ea2c02a8f to your computer and use it in GitHub Desktop.
React + babel + JSX inside a single HTML file
<html>
<head>
<meta charSet="utf-8">
<title>Hello world</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/17.0.0/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@17.0.0/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js">
</script>
</head>
<body>
<div id="app"></div>
<script type="text/babel">
ReactDOM.render(
<h1>Hello World</h1>,
document.getElementById('app')
);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment