FactuGES_ERP/modules/invoices/src/web/hooks/invoices-context.tsx
2025-06-11 15:13:21 +02:00

12 lines
326 B
TypeScript

import { useContext } from "react";
import { InvoicesContext, InvoicesContextType } from "../context";
export const useInvoices = (): InvoicesContextType => {
const context = useContext(InvoicesContext);
if (!context) {
throw new Error("useInvoices must be used within a InvoicesProvider");
}
return context;
};