You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
398 B
12 lines
398 B
import { useContext } from 'react';
|
|
import { invariant } from '@react-dnd/invariant';
|
|
import { DndContext } from '../../common/DndContext';
|
|
/**
|
|
* A hook to retrieve the DragDropManager from Context
|
|
*/
|
|
export function useDragDropManager() {
|
|
const { dragDropManager } = useContext(DndContext);
|
|
invariant(dragDropManager != null, 'Expected drag drop context');
|
|
return dragDropManager;
|
|
}
|