File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -1379,7 +1379,7 @@ module App = {
13791379}
13801380`
13811381
1382- let since_10_1 = ` @@jsxConfig({version: 4, mode: "classic "})
1382+ let since_10_1 = ` @@jsxConfig({version: 4, mode: "automatic "})
13831383
13841384module Button = {
13851385 @react.component
Original file line number Diff line number Diff line change 11let wrapReactApp = code =>
22 ` (function () {
33 ${code}
4- if (!window.reactRoot){
5- const container = document.getElementById("root");
6- const root = ReactDOM.createRoot(container);
7- window.reactRoot = root;
8- }
94 const appContainer$$ = () => App.make();
105 window.reactRoot.render(appContainer$$());
116})();`
Original file line number Diff line number Diff line change @@ -15,6 +15,26 @@ let srcDoc = `
1515 </head>
1616 <body>
1717 <div id="root"></div>
18+ <script type="importmap">
19+ {
20+ "imports": {
21+ "@jsxImportSource": "https://esm.sh/react@${reactVersion}",
22+ "react-dom/client": "https://esm.sh/react-dom@${reactVersion}/client",
23+ "react": "https://esm.sh/react@${reactVersion}",
24+ "react/jsx-runtime": "https://esm.sh/react@${reactVersion}/jsx-runtime"
25+ }
26+ }
27+ </script>
28+ <script type="module">
29+ import * as ReactDOM from 'react-dom/client';
30+ import * as React from 'react';
31+ import * as JsxRuntime from 'react/jsx-runtime';
32+ const container = document.getElementById("root");
33+ const root = ReactDOM.createRoot(container);
34+ window.reactRoot = root;
35+ window.React = React;
36+ window.JsxRuntime = JsxRuntime;
37+ </script>
1838 <script>
1939 window.addEventListener("message", (event) => {
2040 try {
You can’t perform that action at this time.
0 commit comments