urdf-visualizer / viewer /src /hooks /useDragAndDrop.tsx
jurmy24's picture
feat(wip): add viewer
16ab111
raw
history blame contribute delete
429 Bytes
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;
};