mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 13:06:31 +00:00
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