Virtual whiteboard for sketching hand-drawn like diagrams
docs: fix next.js example (#6241)
David Luzarb107c9af2a89
diff --git a/dev-docs/docs/@excalidraw/excalidraw/integration.mdx b/dev-docs/docs/@excalidraw/excalidraw/integration.mdxindex 1fdcb8d8a7..7080c32e95 100644--- a/dev-docs/docs/@excalidraw/excalidraw/integration.mdx+++ b/dev-docs/docs/@excalidraw/excalidraw/integration.mdx@@ -34,14 +34,16 @@ function App() {Since _Excalidraw_ doesn't support server side rendering, you should render the component once the host is `mounted`.+The following worfklow shows one way how to render Excalidraw on Next.js. We'll add more detailed and alternative Next.js examples, soon.+```jsx showLineNumbersimport { useState, useEffect } from "react";export default function App() {- const [Comp, setComp] = useState(null);+ const [Excalidraw, setExcalidraw] = useState(null);useEffect(() => {- import("@excalidraw/excalidraw").then((comp) => setComp(comp.default));+ import("@excalidraw/excalidraw").then((comp) => setExcalidraw(comp.Excalidraw));}, []);- return <>{Comp && <Comp />}</>;+ return <>{Excalidraw && <Excalidraw />}</>;}```