-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: avoid flushSync call during <EditorContent /> lifecycle
#7357
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
base: main
Are you sure you want to change the base?
fix: avoid flushSync call during <EditorContent /> lifecycle
#7357
Conversation
🦋 Changeset detectedLatest commit: b79698f The changes in this PR will be included in the next version bump. This PR includes changesets to release 71 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thanks for doing this @signadou. It would be great to get this patch in. |
|
@bdbch Anything that can be done to get this merged? It's causing a bit of a stir for us still :( |
@tiptap/extension-character-count
@tiptap/extension-dropcursor
@tiptap/extension-focus
@tiptap/extension-gapcursor
@tiptap/extension-list-item
@tiptap/extension-list-keymap
@tiptap/extension-history
@tiptap/extension-placeholder
@tiptap/extension-table-cell
@tiptap/extension-table-header
@tiptap/extension-task-item
@tiptap/extension-table-row
@tiptap/extension-task-list
@tiptap/core
@tiptap/extension-blockquote
@tiptap/extension-bubble-menu
@tiptap/extension-bold
@tiptap/extension-bullet-list
@tiptap/extension-code
@tiptap/extension-code-block
@tiptap/extension-code-block-lowlight
@tiptap/extension-collaboration
@tiptap/extension-collaboration-caret
@tiptap/extension-color
@tiptap/extension-details
@tiptap/extension-drag-handle
@tiptap/extension-drag-handle-react
@tiptap/extension-document
@tiptap/extension-drag-handle-vue-2
@tiptap/extension-drag-handle-vue-3
@tiptap/extension-emoji
@tiptap/extension-floating-menu
@tiptap/extension-file-handler
@tiptap/extension-font-family
@tiptap/extension-hard-break
@tiptap/extension-heading
@tiptap/extension-highlight
@tiptap/extension-image
@tiptap/extension-horizontal-rule
@tiptap/extension-invisible-characters
@tiptap/extension-italic
@tiptap/extension-link
@tiptap/extension-mathematics
@tiptap/extension-mention
@tiptap/extension-list
@tiptap/extension-node-range
@tiptap/extension-ordered-list
@tiptap/extension-paragraph
@tiptap/extension-strike
@tiptap/extension-subscript
@tiptap/extension-superscript
@tiptap/extension-table-of-contents
@tiptap/extension-table
@tiptap/extension-text-align
@tiptap/extension-text-style
@tiptap/extension-text
@tiptap/extension-twitch
@tiptap/extension-typography
@tiptap/extension-underline
@tiptap/extension-youtube
@tiptap/extension-unique-id
@tiptap/extensions
@tiptap/html
@tiptap/markdown
@tiptap/react
@tiptap/pm
@tiptap/static-renderer
@tiptap/suggestion
@tiptap/vue-2
@tiptap/vue-3
@tiptap/starter-kit
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Changes Overview
Fixed the bug where rendering
<EditorContent />conditionally (see the repro sandbox) would throw aflushSync()error.Implementation Approach
Changed
ReactRenderer'sflushSync()condition to use a newisEditorContentInitializedboolean instead ofisInitialized. This ensures thatflushSync()is not called during the<EditorContent />component lifecycle (i.e., during React's commit phase), which would violate React's rules.Testing Done
Verification Steps
<EditorContent />flushSync()error appears in the consoleAdditional Notes
This is an updated version of #6691. The implementation is the same, just rebased onto the current develop branch.
Checklist
Related Issues
Closes #6315 and #6691