diff options
| author | kj_sh604 | 2026-03-15 16:19:35 -0400 |
|---|---|---|
| committer | kj_sh604 | 2026-03-15 16:19:35 -0400 |
| commit | 225db4a7805befe009fe055fc2ef5daedd6c04f9 (patch) | |
| tree | a5b0d073daabaadceb2f5c1b18640d785b5a9c71 /examples/with-script-in-browser/index.tsx | |
| parent | 8ff10d2bf233608b027f8503cb9c7100c9ee3f16 (diff) | |
refactor: examples/
Diffstat (limited to 'examples/with-script-in-browser/index.tsx')
| -rw-r--r-- | examples/with-script-in-browser/index.tsx | 28 |
1 files changed, 28 insertions, 0 deletions
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( + <StrictMode> + <App + appTitle={"Excalidraw Example"} + useCustom={(api: any, args?: any[]) => {}} + excalidrawLib={window.ExcalidrawLib} + > + <Excalidraw /> + </App> + </StrictMode>, +); |
