April 2020
Intermediate to advanced
716 pages
18h 55m
English
We will add a React component named Product to render the individual product details, along with an add to cart option. In this single product view, we will also show a list of related products, as pictured in the following screenshot:

The Product component can be accessed in the browser at the /product/:productID route, which is defined in MainRouter as follows:
mern-marketplace/client/MainRouter.js:
<Route path="/product/:productId" component={Product}/>
The product details and the related product list data will be fetched by calling the relevant APIs with useEffect hooks using the productId specified in the route param, ...
Read now
Unlock full access