-
-
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.
- Loading branch information
1 parent
6719f43
commit b379aa2
Showing
1 changed file
with
12 additions
and
0 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": minor | ||
"@tiptap/core": minor | ||
--- | ||
|
||
This PR significantly improves the performance of React NodeViews in a couple of ways: | ||
|
||
- It now uses useSyncExternalStore to synchronize changes between React & the editor instance | ||
- It dramatically reduces the number of re-renders by re-using instances of React portals that have already been initialized and unaffected by the change made in the editor | ||
|
||
We were seeing performance problems with React NodeViews because a change to one of them would cause a re-render to all instances of node views. For an application that heavily relies on node views in React, this was quite expensive. | ||
This should dramatically cut down on the number of instances that have to re-render, and, making each of those re-renders much less costly. |