Skip to content

Instantly share code, notes, and snippets.

@urielhdz
Created June 20, 2022 16:39
Show Gist options
  • Save urielhdz/f68ab0074478effb83a138eb206db2a3 to your computer and use it in GitHub Desktop.
Save urielhdz/f68ab0074478effb83a138eb206db2a3 to your computer and use it in GitHub Desktop.
React Hello world con importmaps
import React from "react";
import ReactDOM from "react-dom";
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render("Hello world");
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script type="importmap">
{
"imports": {
"react": "https://ga.jspm.io/npm:react@18.3.0-next-522f47345-20220614/dev.index.js",
"react-dom": "https://ga.jspm.io/npm:react-dom@18.3.0-next-522f47345-20220614/dev.index.js"
},
"scopes": {
"https://ga.jspm.io/": {
"process": "https://ga.jspm.io/npm:@jspm/core@2.0.0-beta.24/nodelibs/browser/process.js",
"scheduler": "https://ga.jspm.io/npm:scheduler@0.24.0-next-522f47345-20220614/dev.index.js"
}
}
}
</script>
</head>
<body>
<div id="root"></div>
<script src="/app.js" type="module" > </script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment