fix: empty value
This commit is contained in:
parent
97c63830dd
commit
6b1ff526eb
@ -30,7 +30,7 @@ export const RichText = (props: any) => {
|
||||
const renderLeaf = useCallback((props) => <Leaf {...props} />, []);
|
||||
const editor = useMemo(() => withHistory(withReact(createEditor() as ReactEditor)), []);
|
||||
const slateValue = useMemo(() => {
|
||||
editor.children = JSON.parse(JSON.stringify(value));
|
||||
editor.children = JSON.parse(JSON.stringify(value || []));
|
||||
Editor.normalize(editor, { force: true });
|
||||
return editor.children;
|
||||
}, [editor, value]);
|
||||
|
Loading…
Reference in New Issue
Block a user