Skip to content

Commit

Permalink
Re-render leaf when new properties were added to it (#4347)
Browse files Browse the repository at this point in the history
  • Loading branch information
aiwenar authored Jul 9, 2021
1 parent e79f238 commit 46c8871
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/sixty-ties-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

Re-render leaf when new properties were added to it
2 changes: 1 addition & 1 deletion packages/slate-react/src/components/leaf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)
})
Expand Down

0 comments on commit 46c8871

Please sign in to comment.