Presupuestador_web/client/src/app/quotes/useQuotesContext.tsx

9 lines
283 B
TypeScript
Raw Normal View History

2024-06-29 19:39:25 +00:00
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;
};