docs: fix Browser integration example React import

This commit is contained in:
Arne Keller 2025-04-15 23:39:41 +02:00 committed by GitHub
parent 58f7d33d80
commit 3af9d99ee4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -208,7 +208,7 @@ import TabItem from "@theme/TabItem";
// See https://www.npmjs.com/package/@excalidraw/excalidraw documentation.
import * as ExcalidrawLib from 'https://esm.sh/@excalidraw/excalidraw@0.18.0/dist/dev/index.js?external=react,react-dom';
import React from "https://esm.sh/react@19.0.0";
import ReactDOM from "https://esm.sh/react-dom@19.0.0"
import { createRoot } from "https://esm.sh/react-dom@19.0.0/client";
window.ExcalidrawLib = ExcalidrawLib;
console.log("Excalidraw library", ExcalidrawLib);
@ -228,7 +228,7 @@ const App = () => {
};
const excalidrawWrapper = document.getElementById("app");
const root = ReactDOM.createRoot(excalidrawWrapper);
const root = createRoot(excalidrawWrapper);
root.render(React.createElement(App));
```