1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-20 13:22:04 +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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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