From 225db4a7805befe009fe055fc2ef5daedd6c04f9 Mon Sep 17 00:00:00 2001 From: kj_sh604 Date: Sun, 15 Mar 2026 16:19:35 -0400 Subject: refactor: examples/ --- examples/with-script-in-browser/index.tsx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 examples/with-script-in-browser/index.tsx (limited to 'examples/with-script-in-browser/index.tsx') diff --git a/examples/with-script-in-browser/index.tsx b/examples/with-script-in-browser/index.tsx new file mode 100644 index 0000000..25ad96e --- /dev/null +++ b/examples/with-script-in-browser/index.tsx @@ -0,0 +1,28 @@ +import App from "./components/ExampleApp"; +import React, { StrictMode } from "react"; +import { createRoot } from "react-dom/client"; + +import type * as TExcalidraw from "@excalidraw/excalidraw"; + +import "@excalidraw/excalidraw/index.css"; + +declare global { + interface Window { + ExcalidrawLib: typeof TExcalidraw; + } +} + +const rootElement = document.getElementById("root")!; +const root = createRoot(rootElement); +const { Excalidraw } = window.ExcalidrawLib; +root.render( + + {}} + excalidrawLib={window.ExcalidrawLib} + > + + + , +); -- cgit v1.2.3