chore: update
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { useContext } from "react";
|
||||
import { CartContext } from "./CartContext";
|
||||
|
||||
export function useCart() {
|
||||
const context = useContext(CartContext);
|
||||
if (!context) {
|
||||
throw new Error("useCart must be used within a CartProvider");
|
||||
}
|
||||
return context;
|
||||
}
|
||||
Reference in New Issue
Block a user