({children})
| 794 | const ShoppingCartContext = createContext(null); |
| 795 | |
| 796 | function AppShell({children}) { |
| 797 | const [items, updateItems] = useState([]); |
| 798 | const value = useMemo(() => ({items, updateItems}), [items, updateItems]); |
| 799 | |
| 800 | return ( |
| 801 | <ShoppingCartContext.Provider value={value}> |
| 802 | {children} |
| 803 | </ShoppingCartContext.Provider> |
| 804 | ); |
| 805 | } |
| 806 | |
| 807 | function Page({url}) { |
| 808 | const {items, updateItems} = useContext(ShoppingCartContext); |