-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…5496) The core of the change ended up being quite simple, because we can create the editor within the first render, we need to already schedule it's destruction. Scheduling a destruction, ensures that an instance that was created in that first render pass can be cleaned up. Waiting one more tick than before ensures that we don't accidentally destroy an editor instance that could actually be valid in the next render pass. In StrictMode, there will be two editor instances created, the first will be created & quickly destroyed in 2 ticks. In Normal React, there will only ever be 1 instance created and destroyed only on unmount.
- Loading branch information
1 parent
3f5dbbb
commit 6a0f4f3
Showing
3 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tiptap/react": patch | ||
--- | ||
|
||
Resolves a bug where `useEditor` may not properly cleanup an instance created when in React's StrictMode #5492 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters