TypeError: Cannot read properties of undefined (reading 'map')
at ProductGrid (ProductGrid.jsx:47:18)
This error occurred in the <ProductGrid> component:
44 | const { products, loading } = useProducts();
45 | if (loading) return <Spinner />;
46 |
> 47 | return products.map((p) => <ProductCard key={p.id} {...p} />);
| ^
48 |
Component Stack
at ProductGrid (ProductGrid.jsx:47)
at ShopPage (pages/shop.jsx:12)
at Router (node_modules/react-router/dist/index.js:388)
at App (App.jsx:8)