diff --git a/.changeset/breezy-lizards-travel.md b/.changeset/breezy-lizards-travel.md new file mode 100644 index 0000000000..6f4f0b6c04 --- /dev/null +++ b/.changeset/breezy-lizards-travel.md @@ -0,0 +1,5 @@ +--- +'slate-react': patch +--- + +Fixed a bug in the memoization logic for the leaves of text nodes. diff --git a/packages/slate-react/src/components/leaf.tsx b/packages/slate-react/src/components/leaf.tsx index b3b7996abf..dcb6c4fa15 100644 --- a/packages/slate-react/src/components/leaf.tsx +++ b/packages/slate-react/src/components/leaf.tsx @@ -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] )