diff --git a/src/hooks/useEditorView.ts b/src/hooks/useEditorView.ts index ca019493..adba099e 100644 --- a/src/hooks/useEditorView.ts +++ b/src/hooks/useEditorView.ts @@ -116,13 +116,13 @@ export function useEditorView( } }, [editorProps, mount, state, view]); - useLayoutEffect(() => { - if (stateProp) view?.setProps({ state: stateProp }); - }, [view, stateProp]); - useLayoutEffect(() => { view?.setProps(nonStateProps); }, [view, nonStateProps]); + useLayoutEffect(() => { + if (stateProp) view?.setProps({ state: stateProp }); + }, [view, stateProp]); + return view; }