diff --git a/src/hooks/useEditorView.ts b/src/hooks/useEditorView.ts index adba099e..e18ba24d 100644 --- a/src/hooks/useEditorView.ts +++ b/src/hooks/useEditorView.ts @@ -71,19 +71,11 @@ export function useEditorView( const editorProps = withFlushedDispatch(props, forceUpdate); - const stateProp = "state" in editorProps ? editorProps.state : undefined; - const state = "defaultState" in editorProps ? editorProps.defaultState : editorProps.state; - const nonStateProps = Object.fromEntries( - Object.entries(editorProps).filter( - ([propName]) => propName !== "state" && propName !== "defaultState" - ) - ); - useLayoutEffect(() => { return () => { if (view) { @@ -117,12 +109,8 @@ export function useEditorView( }, [editorProps, mount, state, view]); useLayoutEffect(() => { - view?.setProps(nonStateProps); - }, [view, nonStateProps]); - - useLayoutEffect(() => { - if (stateProp) view?.setProps({ state: stateProp }); - }, [view, stateProp]); + view?.setProps(editorProps); + }, [view, editorProps]); return view; }