Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up layout effects in useEditor #153

Closed
wants to merge 1 commit into from
Closed

Conversation

smoores-dev
Copy link
Collaborator

@smoores-dev smoores-dev commented Dec 18, 2024

Fixes #152.

We (I) somehow ended up with multiple layout effects trying to manage when to replace the editor view. This made it hard to ensure that the view.dom wasn't getting cleared out by EditorView before React did its own cleanup.

This moves everything into one effect, and makes sure that we set the EditorView to null before updating to a new EditorView with the same mount (which is the case that triggers ProseMirror clearing out the mount before React has a chance to)

@smoores-dev smoores-dev requested a review from a team as a code owner December 18, 2024 22:55
@smoores-dev smoores-dev enabled auto-merge (squash) December 18, 2024 22:56
@smoores-dev smoores-dev disabled auto-merge December 18, 2024 23:01
@smoores-dev smoores-dev marked this pull request as draft December 18, 2024 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when unmounting <ProseMirror> component?
1 participant