File tree 3 files changed +21
-6
lines changed
3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -1379,7 +1379,7 @@ module App = {
1379
1379
}
1380
1380
`
1381
1381
1382
- let since_10_1 = ` @@jsxConfig({version: 4, mode: "classic "})
1382
+ let since_10_1 = ` @@jsxConfig({version: 4, mode: "automatic "})
1383
1383
1384
1384
module Button = {
1385
1385
@react.component
Original file line number Diff line number Diff line change 1
1
let wrapReactApp = code =>
2
2
` (function () {
3
3
${code}
4
- if (!window.reactRoot){
5
- const container = document.getElementById("root");
6
- const root = ReactDOM.createRoot(container);
7
- window.reactRoot = root;
8
- }
9
4
const appContainer$$ = () => App.make();
10
5
window.reactRoot.render(appContainer$$());
11
6
})();`
Original file line number Diff line number Diff line change @@ -15,6 +15,26 @@ let srcDoc = `
15
15
</head>
16
16
<body>
17
17
<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>
18
38
<script>
19
39
window.addEventListener("message", (event) => {
20
40
try {
You can’t perform that action at this time.
0 commit comments