mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-01-17 21:49:20 +01:00
Drop a leftover useRef()
call (#5510)
* Drop a leftover `useRef()` call It was first introduced in #4819 but then the usage of this ref was removed with #4874 So the ref remained unused since then. * Add a changeset
This commit is contained in:
parent
70166d6386
commit
13c7d271e3
5
.changeset/flat-coats-buy.md
Normal file
5
.changeset/flat-coats-buy.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'slate-react': patch
|
||||
---
|
||||
|
||||
Remove an unused React ref
|
@ -1,4 +1,4 @@
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
import { Descendant, Editor, Node, Scrubber } from 'slate'
|
||||
import { FocusedContext } from '../hooks/use-focused'
|
||||
import { useIsomorphicLayoutEffect } from '../hooks/use-isomorphic-layout-effect'
|
||||
@ -24,7 +24,6 @@ export const Slate = (props: {
|
||||
onChange?: (value: Descendant[]) => void
|
||||
}) => {
|
||||
const { editor, children, onChange, initialValue, ...rest } = props
|
||||
const unmountRef = useRef(false)
|
||||
|
||||
const [context, setContext] = React.useState<SlateContextValue>(() => {
|
||||
if (!Node.isNodeList(initialValue)) {
|
||||
@ -66,7 +65,6 @@ export const Slate = (props: {
|
||||
|
||||
return () => {
|
||||
EDITOR_TO_ON_CHANGE.set(editor, () => {})
|
||||
unmountRef.current = true
|
||||
}
|
||||
}, [editor, onContextChange])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user