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:
@@ -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 = () => {
|
||||||
|
Reference in New Issue
Block a user