From 9717ec7293f47cb7372447c959e21b0a2fc4fd25 Mon Sep 17 00:00:00 2001 From: angelo Date: Wed, 15 Nov 2023 04:35:38 +0100 Subject: [PATCH] fix: :bug: import react dom on node --- src/runtime/components/ExcalidrawBoard.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/components/ExcalidrawBoard.vue b/src/runtime/components/ExcalidrawBoard.vue index 913111c..597f1ef 100644 --- a/src/runtime/components/ExcalidrawBoard.vue +++ b/src/runtime/components/ExcalidrawBoard.vue @@ -12,10 +12,12 @@ const props = defineProps() const excalidrawRef: Ref = ref(null) let root: null | Root = null +const ReactDOMClient = await import('react-dom/client') + onMounted(() => { nextTick(async () => { if (excalidrawRef.value) { - root = (await import('react-dom/client')).createRoot(excalidrawRef.value) + root = ReactDOMClient.createRoot(excalidrawRef.value) const Excalidraw = (await import('@excalidraw/excalidraw')).Excalidraw root.render(React.createElement(Excalidraw, props as any))