@shopify/hydrogen-react
Version:
React components, hooks, and utilities for creating custom Shopify storefronts
23 lines (22 loc) • 578 B
JavaScript
import { jsx } from "react/jsx-runtime";
import { useContext, createContext } from "react";
const CartLineContext = createContext(null);
function useCartLine() {
const context = useContext(CartLineContext);
if (context == null) {
throw new Error("Expected a cart line context but none was found");
}
return context;
}
function CartLineProvider({
children,
line
}) {
return /* @__PURE__ */ jsx(CartLineContext.Provider, { value: line, children });
}
export {
CartLineContext,
CartLineProvider,
useCartLine
};
//# sourceMappingURL=CartLineProvider.mjs.map