diff --git a/.changeset/flat-coats-buy.md b/.changeset/flat-coats-buy.md new file mode 100644 index 0000000000..282b4befe1 --- /dev/null +++ b/.changeset/flat-coats-buy.md @@ -0,0 +1,5 @@ +--- +'slate-react': patch +--- + +Remove an unused React ref diff --git a/packages/slate-react/src/components/slate.tsx b/packages/slate-react/src/components/slate.tsx index 83204940f5..2e1d69d730 100644 --- a/packages/slate-react/src/components/slate.tsx +++ b/packages/slate-react/src/components/slate.tsx @@ -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(() => { if (!Node.isNodeList(initialValue)) { @@ -66,7 +65,6 @@ export const Slate = (props: { return () => { EDITOR_TO_ON_CHANGE.set(editor, () => {}) - unmountRef.current = true } }, [editor, onContextChange])