1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-23 23:42:56 +02:00
* Revert #5542

Revert due to issues introduced.

* Add changeset
This commit is contained in:
Dylan Schiemann
2023-11-10 09:25:29 -07:00
committed by GitHub
parent fc081816e0
commit 22495e143d
2 changed files with 5 additions and 16 deletions

View File

@@ -0,0 +1,5 @@
---
'slate-react': patch
---
Revert #5542

View File

@@ -4,7 +4,6 @@ import throttle from 'lodash/throttle'
import React, { import React, {
useCallback, useCallback,
useEffect, useEffect,
useLayoutEffect,
useMemo, useMemo,
useReducer, useReducer,
useRef, 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 // The autoFocus TextareaHTMLAttribute doesn't do anything on a div, so it
// needs to be manually focused. // needs to be manually focused.
useEffect(() => { useEffect(() => {