mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-03-21 13:49:44 +01:00
fix(slate-react): use Text.equals to compare leaf (#4175)
* fix(slate-react): use Text.equals to compare leaf * refactor(slate-react): simplify MenoizedLeaf logic * Create breezy-lizards-travel.md * Update packages/slate-react/src/components/leaf.tsx Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com> Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
This commit is contained in:
parent
13b3f9c783
commit
bde6e80476
5
.changeset/breezy-lizards-travel.md
Normal file
5
.changeset/breezy-lizards-travel.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'slate-react': patch
|
||||
---
|
||||
|
||||
Fixed a bug in the memoization logic for the leaves of text nodes.
|
@ -104,7 +104,6 @@ const MemoizedLeaf = React.memo(Leaf, (prev, next) => {
|
||||
next.renderLeaf === prev.renderLeaf &&
|
||||
next.renderPlaceholder === prev.renderPlaceholder &&
|
||||
next.text === prev.text &&
|
||||
next.leaf.text === prev.leaf.text &&
|
||||
Text.equals(next.leaf, prev.leaf) &&
|
||||
next.leaf[PLACEHOLDER_SYMBOL] === prev.leaf[PLACEHOLDER_SYMBOL]
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user