MyProducts component for shop owners

In contrast to the Products component, the MyProducts component in client/product/MyProducts.js is only for displaying products to sellers so they can manage the products in each shop:

The MyProducts component is added to the EditShop view, so sellers can manage a shop and its contents in one place. It is provided the shop's ID in a prop, so relevant products can be fetched.

mern-marketplace/client/shop/EditShop.js:

<MyProducts shopId={this.match.params.shopId}/>

In MyProducts, the relevant products are first loaded in componentDidMount.

mern-marketplace/client/product/MyProducts.js:

componentDidMount = ...

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.