Skip to content

Instantly share code, notes, and snippets.

@qnighy
Created August 29, 2022 12:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qnighy/53dd0d0836b700cd8d522db020943112 to your computer and use it in GitHub Desktop.
Save qnighy/53dd0d0836b700cd8d522db020943112 to your computer and use it in GitHub Desktop.
React + JSX + ESM with single HTML
<script type="module" src="https://jspm.dev/@babel/standalone"></script>
<script type="text/jsx" data-type="module">
import React from "https://jspm.dev/react";
// import { createRoot } from "https://jspm.dev/react-dom/client";
import { createRoot } from "https://jspm.dev/react-dom";
const root = createRoot(document.querySelector("#main"));
root.render(
<div>
Hello, world!
</div>
);
</script>
<div id="main"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment