mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-22 15:02:51 +02:00
* Revert #5542 Revert due to issues introduced. * Add changeset
This commit is contained in:
@@ -4,7 +4,6 @@ import throttle from 'lodash/throttle'
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useLayoutEffect,
|
||||
useMemo,
|
||||
useReducer,
|
||||
useRef,
|
||||
@@ -177,21 +176,6 @@ export const Editable = (props: EditableProps) => {
|
||||
[]
|
||||
)
|
||||
|
||||
useLayoutEffect(() => {
|
||||
return () => {
|
||||
if (state == null) {
|
||||
return
|
||||
}
|
||||
// Avoid leaking DOM nodes when this component is unmounted.
|
||||
if (state.latestElement != null) {
|
||||
state.latestElement.remove()
|
||||
}
|
||||
if (state.latestElement != null) {
|
||||
state.latestElement = null
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
|
||||
// The autoFocus TextareaHTMLAttribute doesn't do anything on a div, so it
|
||||
// needs to be manually focused.
|
||||
useEffect(() => {
|
||||
|
Reference in New Issue
Block a user