mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-12 10:14:02 +02:00
bugfix: moves EDITOR_TO_ON_CHANGE into useEffect for double useEffect call in react 18 (#5261)
This commit is contained in:
@@ -61,9 +61,9 @@ export const Slate = (props: {
|
||||
handleSelectorChange(editor)
|
||||
}, [onChange])
|
||||
|
||||
EDITOR_TO_ON_CHANGE.set(editor, onContextChange)
|
||||
|
||||
useEffect(() => {
|
||||
EDITOR_TO_ON_CHANGE.set(editor, onContextChange)
|
||||
|
||||
return () => {
|
||||
EDITOR_TO_ON_CHANGE.set(editor, () => {})
|
||||
unmountRef.current = true
|
||||
|
Reference in New Issue
Block a user