Skip to content

Commit

Permalink
dont separate setprops
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyaGurevich committed Sep 11, 2023
1 parent c1695fb commit fa161fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hooks/useEditorView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ export function useEditorView<T extends HTMLElement = HTMLElement>(
}
}, [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;
}

0 comments on commit fa161fb

Please sign in to comment.