1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-12 02:03:59 +02:00

feat: add useComposing hook (#5695)

This commit is contained in:
yf-yang
2024-08-21 07:03:03 +08:00
committed by GitHub
parent e5fed793e7
commit 6cb38e37a4
4 changed files with 854 additions and 813 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
import { createContext, useContext } from 'react'
/**
* A React context for sharing the `composing` state of the editor.
*/
export const ComposingContext = createContext(false)
/**
* Get the current `composing` state of the editor.
*/
export const useComposing = (): boolean => {
return useContext(ComposingContext)
}