tiptap
tiptap copied to clipboard
fix: Don't init when editor is destroyed
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
- [x] The changes are not breaking the editor
- [x] Added tests where possible
- [x] Followed the guidelines
- [x] Fixed linting issues
Related issues
This issue is similar to the various problems described in https://github.com/ueberdosis/tiptap/issues/1451 (and other linked issues in that thread) and manifests itself with the same TypeError: Cannot read property 'matchesNode' of null
.
Deploy Preview for tiptap-embed ready!
Name | Link |
---|---|
Latest commit | 1bce804ce7f7fb9410485e62e7012f18a73a3af4 |
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
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 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...