File size: 429 Bytes
16ab111
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import {
  DragAndDropContextType,
  DragAndDropContext,
} from "@/contexts/DragAndDropContext";
import { useContext } from "react";

// Custom hook to use the DragAndDrop context
export const useDragAndDrop = (): DragAndDropContextType => {
  const context = useContext(DragAndDropContext);
  if (context === undefined) {
    throw new Error("useDragAndDrop must be used within a DragAndDropProvider");
  }
  return context;
};