Skip to content

fix: react 19 strict mode compatibility #1726

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

YousefED
Copy link
Collaborator

closes #1618

I think this was caused because in React 19, "refs" also quickly remount when in StrictMode.

We didn't correctly cleanup when the editor was unmounted, causing a nested flushSync here

Ideally we add a test for this, but this might be complicated with our setup (the main repo now uses React 18).

Copy link

vercel bot commented May 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview May 29, 2025 8:41pm
blocknote-website ✅ Ready (Inspect) Visit Preview May 29, 2025 8:41pm

@YousefED
Copy link
Collaborator Author

@nperez0111 upon a second look it seems like unmount was added here: ueberdosis/tiptap@8de8e13#diff-9b7c004a70a95a9e7b2b49f3761403a4abfe14fae1490e32c86306794017e27dR171

I suppose the right solution would be to update tiptap and call unmount instead, right?

@YousefED YousefED requested a review from nperez0111 May 29, 2025 20:42
Copy link

pkg-pr-new bot commented May 29, 2025

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/ariakit@1726

@blocknote/code-block

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/code-block@1726

@blocknote/core

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/core@1726

@blocknote/mantine

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/mantine@1726

@blocknote/react

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/react@1726

@blocknote/server-util

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/server-util@1726

@blocknote/shadcn

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/shadcn@1726

@blocknote/xl-ai

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-ai@1726

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-docx-exporter@1726

@blocknote/xl-multi-column

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-multi-column@1726

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-odt-exporter@1726

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-pdf-exporter@1726

commit: 41fd54c

@nperez0111
Copy link
Contributor

@YousefED in the future, yes. But, that is still on their v3 beta so will be part of the larger upgrade to v3. For now, this is a valid fix

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.

Multiple BlockNote mounted editors cause flushSync errors
2 participants