All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
12 lines
382 B
JavaScript
12 lines
382 B
JavaScript
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;
|
|
}
|