Uecko_ERP/modules/customers/src/web/hooks/use-customers-context.tsx

12 lines
340 B
TypeScript
Raw Normal View History

2025-08-11 17:49:52 +00:00
import { useContext } from "react";
import { CustomersContext, CustomersContextType } from "../context";
export const useCustomersContext = (): CustomersContextType => {
const context = useContext(CustomersContext);
if (!context) {
throw new Error("useCustomers must be used within a CustomersProvider");
}
return context;
};