Files
parfum_agsd/parfum-shop/src/shop/useShop.js
T

11 lines
263 B
JavaScript

import { useContext } from "react";
import { ShopContext } from "./ShopContextBase";
export const useShop = () => {
const value = useContext(ShopContext);
if (!value) {
throw new Error("useShop must be used inside ShopProvider.");
}
return value;
};