This commit is contained in:
11
node_modules/react-dnd/lib/hooks/useDragDropManager.js
generated
vendored
Normal file
11
node_modules/react-dnd/lib/hooks/useDragDropManager.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useContext } from 'react';
|
||||
import { invariant } from '@react-dnd/invariant';
|
||||
import { DndContext } from '../core';
|
||||
/**
|
||||
* A hook to retrieve the DragDropManager from Context
|
||||
*/
|
||||
export function useDragDropManager() {
|
||||
const { dragDropManager } = useContext(DndContext);
|
||||
invariant(dragDropManager != null, 'Expected drag drop context');
|
||||
return dragDropManager;
|
||||
}
|
||||
Reference in New Issue
Block a user