1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 04:20:26 +02:00

Fix useEditor not inside Slate error caused by introduce useSlateStatic (#4027)

This commit is contained in:
Ulion
2021-01-14 22:20:44 +08:00
committed by GitHub
parent 228f4fa94f
commit b5859b7e2e

View File

@@ -1,16 +1,10 @@
import { createContext, useContext } from 'react' import { useContext } from 'react'
import { ReactEditor } from '../plugin/react-editor' import { EditorContext } from './use-slate-static'
/**
* A React context for sharing the editor object.
* @deprecated Use useSlateStatic instead.
*/
export const EditorContext = createContext<ReactEditor | null>(null)
/** /**
* Get the current editor object from the React context. * Get the current editor object from the React context.
* @deprecated Use useSlateStatic instead.
*/ */
export const useEditor = () => { export const useEditor = () => {