Presupuestador_web/client/src/app/quotes/useQuotesContext.tsx
2024-06-29 21:39:25 +02:00

9 lines
283 B
TypeScript

import { useContext } from "react";
import { QuotesContext } from "./QuotesContext";
export const useQuotesContext = () => {
const context = useContext(QuotesContext);
if (context === null) throw new Error("useQuotes must be used within a QuotesProvider");
return context;
};