fix: avoid flushSync call during <EditorContent /> lifecycle#7357
fix: avoid flushSync call during <EditorContent /> lifecycle#7357signadou wants to merge 3 commits intoueberdosis:mainfrom
flushSync call during <EditorContent /> lifecycle#7357Conversation
🦋 Changeset detectedLatest commit: 025b092 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: |
|
@bdbch Any news? 🙏 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bdbch
left a comment
There was a problem hiding this comment.
Before we go forward I'd need to test this PR extensively. We had a lot of back-and-forth with flushSync implementations where prior "fixes" broke other functionalities again.
I'll take a look tomorrow.
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