|
9 | 9 | <body> |
10 | 10 | <div id="app"></div> |
11 | 11 |
|
12 | | - <!-- React 19 UMD (update versions if needed) --> |
13 | | - <script src="https://unpkg.com/react@19/umd/react.development.js" crossorigin></script> |
14 | | - <script src="https://unpkg.com/react-dom@19/umd/react-dom.development.js" crossorigin></script> |
| 12 | + <!-- React 19 via ESM (React 19 dropped UMD builds) --> |
| 13 | + <script type="module"> |
| 14 | + import React from 'https://esm.sh/react@19'; |
| 15 | + import ReactDOM from 'https://esm.sh/react-dom@19'; |
| 16 | + import { createRoot } from 'https://esm.sh/react-dom@19/client'; |
15 | 17 |
|
16 | | - <!-- react-quill-new dist bundle --> |
17 | | - <script src="/assets/react-quill.js"></script> |
18 | | - <script src="/_shared/demo-reactquill.js"></script> |
19 | | - <script> |
20 | | - mountReactQuill(document.getElementById('app'), { title: 'React 19 + Quill 2' }); |
| 18 | + // Expose as globals for the IIFE bundle |
| 19 | + window.React = React; |
| 20 | + window.ReactDOM = ReactDOM; |
| 21 | + window.ReactDOM.createRoot = createRoot; |
| 22 | + |
| 23 | + // Load react-quill bundle |
| 24 | + const bundleScript = document.createElement('script'); |
| 25 | + bundleScript.src = '/assets/react-quill.js'; |
| 26 | + bundleScript.onload = () => { |
| 27 | + // Load shared demo script |
| 28 | + const demoScript = document.createElement('script'); |
| 29 | + demoScript.src = '/_shared/demo-reactquill.js'; |
| 30 | + demoScript.onload = () => { |
| 31 | + mountReactQuill(document.getElementById('app'), { title: 'React 19 + Quill 2' }); |
| 32 | + }; |
| 33 | + document.body.appendChild(demoScript); |
| 34 | + }; |
| 35 | + document.body.appendChild(bundleScript); |
21 | 36 | </script> |
22 | 37 | </body> |
23 | 38 | </html> |
|
0 commit comments