diff --git a/.changeset/sixty-ties-fetch.md b/.changeset/sixty-ties-fetch.md new file mode 100644 index 000000000..fa25a8458 --- /dev/null +++ b/.changeset/sixty-ties-fetch.md @@ -0,0 +1,5 @@ +--- +'slate-react': patch +--- + +Re-render leaf when new properties were added to it diff --git a/packages/slate-react/src/components/leaf.tsx b/packages/slate-react/src/components/leaf.tsx index 674a477c1..b3b7996ab 100644 --- a/packages/slate-react/src/components/leaf.tsx +++ b/packages/slate-react/src/components/leaf.tsx @@ -105,7 +105,7 @@ const MemoizedLeaf = React.memo(Leaf, (prev, next) => { next.renderPlaceholder === prev.renderPlaceholder && next.text === prev.text && next.leaf.text === prev.leaf.text && - Text.matches(next.leaf, prev.leaf) && + Text.equals(next.leaf, prev.leaf) && next.leaf[PLACEHOLDER_SYMBOL] === prev.leaf[PLACEHOLDER_SYMBOL] ) })