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

fix: Don't init when editor is destroyed #4029

Merged
merged 1 commit into from
May 17, 2024

Conversation

tomi-bigpi
Copy link
Contributor

Please describe your changes

Adds a check to see if the EditorContent editor is already destroyed when init is called. This can happen due to using React.StrictMode where the editor is re-rendered back-to-back automatically by React.

How did you accomplish your changes

Extended the existing check to include verifying that the editor hasn't already been destroyed.

How have you tested your changes

Manual testing.

How can we verify your changes

Unfortunately, I don't have a clean reproduction available at this time.

Remarks

Checklist

  • The changes are not breaking the editor
  • Added tests where possible
  • Followed the guidelines
  • Fixed linting issues

Related issues

This issue is similar to the various problems described in #1451 (and other linked issues in that thread) and manifests itself with the same TypeError: Cannot read property 'matchesNode' of null.

@netlify
Copy link

netlify bot commented May 8, 2023

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit 1bce804
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/64596a4b62a6ba0008c132d1
😎 Deploy Preview https://deploy-preview-4029--tiptap-embed.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@gl3nn
Copy link

gl3nn commented May 3, 2024

We are currently seeing an error that might be fixed by this. It only occurs with strict mode on; and it is clear that the editor is destroyed in the stack trace. Did you find a temporary work around?

@tomi-bigpi
Copy link
Contributor Author

We are currently seeing an error that might be fixed by this. It only occurs with strict mode on; and it is clear that the editor is destroyed in the stack trace. Did you find a temporary work around?

We're still patching this locally...

@nperez0111 nperez0111 merged commit 32ed87b into ueberdosis:develop May 17, 2024
14 checks passed
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.

None yet

4 participants