bc518174
王天杨
提交两个项目文件
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import { invariant } from '@react-dnd/invariant'
import type { DragDropManager } from 'dnd-core'
import { useContext } from 'react'
import { DndContext } from '../core/index.js'
/**
* A hook to retrieve the DragDropManager from Context
*/
export function useDragDropManager(): DragDropManager {
const { dragDropManager } = useContext(DndContext)
invariant(dragDropManager != null, 'Expected drag drop context')
return dragDropManager as DragDropManager
}
|