mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-23 17:07:49 +08:00
12 lines
331 B
TypeScript
12 lines
331 B
TypeScript
import { createContext, useContext } from 'react'
|
|
|
|
export interface ReactNodeViewContextProps {
|
|
onDragStart: (event: DragEvent) => void,
|
|
}
|
|
|
|
export const ReactNodeViewContext = createContext<Partial<ReactNodeViewContextProps>>({
|
|
onDragStart: undefined,
|
|
})
|
|
|
|
export const useReactNodeView = () => useContext(ReactNodeViewContext)
|