Files
tiptap/packages/react/src/useReactNodeView.ts
2021-09-30 21:13:37 +02:00

13 lines
392 B
TypeScript

import { createContext, useContext } from 'react'
export interface ReactNodeViewContextProps {
onDragStart: (event: DragEvent) => void,
nodeViewContentRef: (element: HTMLElement | null) => void,
}
export const ReactNodeViewContext = createContext<Partial<ReactNodeViewContextProps>>({
onDragStart: undefined,
})
export const useReactNodeView = () => useContext(ReactNodeViewContext)