ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
30.02k stars 3.26k forks source link

slate.tsx component unused varialbe #5402

Open mohammad-saadati opened 1 year ago

mohammad-saadati commented 1 year ago

Problem there is a variable in this directory: slate-react/src/components/slate.tsx:

const unmountRef = useRef(false)

and the value is changed in useEffect clean function: useEffect(() => { EDITOR_TO_ON_CHANGE.set(editor, onContextChange)

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

}, [editor, onContextChange])

Solution unmountRef can be removed.

Noothan-am commented 1 year ago

hey @mohammad-saadati, are you working on this issue ?