Skip to content

Commit

Permalink
Drop a leftover useRef() call
Browse files Browse the repository at this point in the history
It was first introduced in ianstormtaylor#4819
but then the usage of this ref was removed with ianstormtaylor#4874

So the ref remained unused since then.
  • Loading branch information
e1himself committed Sep 14, 2023
1 parent 70166d6 commit 26b448b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/slate-react/src/components/slate.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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)) {
Expand Down Expand Up @@ -66,7 +65,6 @@ export const Slate = (props: {

return () => {
EDITOR_TO_ON_CHANGE.set(editor, () => {})
unmountRef.current = true
}
}, [editor, onContextChange])

Expand Down

0 comments on commit 26b448b

Please sign in to comment.