Fix hot reload for RichContent
This commit is contained in:
parent
b0242c6253
commit
1b311a7198
|
@ -254,7 +254,11 @@ export function RichContent(props: {
|
||||||
content,
|
content,
|
||||||
editable: false,
|
editable: false,
|
||||||
})
|
})
|
||||||
useEffect(() => void editor?.commands?.setContent(content), [editor, content])
|
useEffect(
|
||||||
|
// Check isDestroyed here so hot reload works, see https://github.com/ueberdosis/tiptap/issues/1451#issuecomment-941988769
|
||||||
|
() => void !editor?.isDestroyed && editor?.commands?.setContent(content),
|
||||||
|
[editor, content]
|
||||||
|
)
|
||||||
|
|
||||||
return <EditorContent className={className} editor={editor} />
|
return <EditorContent className={className} editor={editor} />
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user