Compare commits

...

2 Commits

View File

@ -94,7 +94,13 @@ const SelectDropdown = ({
};
export const ExpenseContext = createContext();
export const useExpenseContext = () => useContext(ExpenseContext);
export const useExpenseContext = () => {
const context = useContext(ExpenseContext);
if (!context) {
throw new Error("useExpenseContext must be used within an ExpenseProvider");
}
return context;
}
const ExpensePage = () => {
const [isOpen, setIsOpen] = useState(false);