EditShop component

The EditShop component will show a form similar to the create new shop form, pre-populated with the existing shop details. This component will also show a list of the products in this shop, to be discussed in the Products section:

The form part is similar to the form in the NewShop component, with the same form fields and a formData object that holds the multipart form data sent with the update fetch method.

The EditShop component is only accessible by authorized shop owners. So we will add a PrivateRoute in the MainRouter component, which will render this component only for authorized users at /seller/shop/edit/:shopId ...

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.