You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In exploring using suspense on a page that has a react-prosemirror field, I'm running into an error when: the page loads, then suspends for some reason, then un-suspends.
This seems to be what's happening:
The page loads, including the <ProseMirror> component
The page suspends for some reason (in my case, I was triggering a refetch and had put the Suspense boundary at a higher level)
When React suspends, it calls the cleanup function of layout effects! In their words: "If React needs to hide the already visible content because it suspended again, it will clean up layout Effects in the content tree. When the content is ready to be shown again, React will fire the layout Effects again. This ensures that Effects measuring the DOM layout don’t try to do this while the content is hidden."
When suspense ends and the component is re-rendered (with the rest of its state maintained), it still has access to the EditorView (that had destroy() called on it), but now that view is missing key fields!
The text was updated successfully, but these errors were encountered:
In exploring using suspense on a page that has a react-prosemirror field, I'm running into an error when: the page loads, then suspends for some reason, then un-suspends.
This seems to be what's happening:
<ProseMirror>
componentuseLayoutEffect
to run:view.destroy();
, even though the component isn't actually unmountingEditorView
(that haddestroy()
called on it), but now thatview
is missing key fields!The text was updated successfully, but these errors were encountered: