Skip to content

Commit 57bdd4f

Browse files
changlin-cnflexi
andauthored
Fix Slate component to properly handle editor updates by adding `edit… (#6012)
* Fix Slate component to properly handle editor updates by adding `editor` as a dependency in the useEffect hook. * Add changeset --------- Co-authored-by: flexi <felix@put.com>
1 parent d211122 commit 57bdd4f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/modern-crabs-try.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'slate-react': patch
3+
---
4+
5+
Fix Slate component to properly handle editor updates by adding `editor` as a dependency in the useEffect hook.

packages/slate-react/src/components/slate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export const Slate = (props: {
111111
document.removeEventListener('blur', fn, true)
112112
}
113113
}
114-
}, [])
114+
}, [editor])
115115

116116
return (
117117
<SlateSelectorContext.Provider value={selectorContext}>

0 commit comments

Comments
 (0)