Skip to content

Commit

Permalink
fix: 🐛 import react dom on node
Browse files Browse the repository at this point in the history
  • Loading branch information
AngeloSchulerPiletti committed Nov 15, 2023
1 parent d196ae0 commit 9717ec7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/runtime/components/ExcalidrawBoard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ const props = defineProps<Props>()
const excalidrawRef: Ref<HTMLDivElement | null> = 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))
Expand Down

0 comments on commit 9717ec7

Please sign in to comment.