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

Avoid flushSync errors in useEffect #48

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

sjdemartini
Copy link
Owner

ueberdosis/tiptap#3764 (comment)

Otherwise updating content of RichTextEditor will give the following error (as of the recent Tiptap version bump):

Warning: flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.
    at RichTextEditor (http://localhost:5173/src/RichTextEditor.tsx?t=1686945132689:21:90)

@sjdemartini sjdemartini merged commit 651f5e1 into main Jun 16, 2023
@sjdemartini sjdemartini deleted the use-microtasks-to-avoid-flushSync-issues branch June 16, 2023 19:53
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.

1 participant