mirror of
				https://github.com/excalidraw/excalidraw.git
				synced 2025-10-31 10:54:33 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			686 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			686 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import React, { StrictMode } from "react";
 | |
| import { createRoot } from "react-dom/client";
 | |
| 
 | |
| import "@excalidraw/excalidraw/index.css";
 | |
| 
 | |
| import type * as TExcalidraw from "@excalidraw/excalidraw";
 | |
| 
 | |
| import App from "./components/ExampleApp";
 | |
| 
 | |
| 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>,
 | |
| );
 | 
