File size: 361 Bytes
16ab111
 
 
6bc7874
16ab111
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import { UrdfContextType, UrdfContext } from "@/contexts/UrdfContext";
import { useContext } from "react";

// Custom hook to use the Urdf context
export const useUrdf = (): UrdfContextType => {
  const context = useContext(UrdfContext);
  if (context === undefined) {
    throw new Error("useUrdf must be used within a UrdfProvider");
  }
  return context;
};