-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react): optimize
useEditor
and useEditorState
to reduce numbe…
- Loading branch information
1 parent
84ebd51
commit 7c8889a
Showing
10 changed files
with
595 additions
and
387 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,12 @@ | ||
--- | ||
"@tiptap/react": patch | ||
--- | ||
|
||
Optimize `useEditor` and `useEditorState` to reduce number of instances created while still being performant #5432 | ||
|
||
The core of this change is two-fold: | ||
- have the effect run on every render (i.e. without a dep array) | ||
- schedule destruction of instances, but bail on the actual destruction if the instance was still mounted and a new instance had not been created yet | ||
|
||
It should plug a memory leak, where editor instances could be created but not cleaned up in strict mode. | ||
As well as fixing a bug where a re-render, with deps, was not applying new options that were set on `useEditor`. |
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
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
Oops, something went wrong.