We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 059185f commit 09a6140Copy full SHA for 09a6140
packages/richtext-lexical/src/field/Field.tsx
@@ -147,7 +147,12 @@ const RichTextComponent: React.FC<
147
// If we used JSON.stringify, the editor would re-mount every time you save the document, as the order of keys changes => change detected => re-mount.
148
if (
149
prevValueRef.current !== value &&
150
- !dequal(JSON.parse(JSON.stringify(prevValueRef.current)), value)
+ !dequal(
151
+ prevValueRef.current != null
152
+ ? JSON.parse(JSON.stringify(prevValueRef.current))
153
+ : prevValueRef.current,
154
+ value,
155
+ )
156
) {
157
prevInitialValueRef.current = initialValue
158
prevValueRef.current = value
0 commit comments