May 2018
Intermediate to advanced
470 pages
13h 54m
English
The Shop component will render the shop details and also a list of products in the specified shop using a product list component, which will be discussed in the Products section:

The Shop component can be accessed in the browser at the /shops/:shopId route, which is defined in MainRouter as follows.
mern-marketplace/client/MainRouter.js:
<Route path="/shops/:shopId" component={Shop}/>
In componentDidMount, the shop details are fetched using the read method from api-shop.js.
mern-marketplace/client/shop/Shop.js:
componentDidMount = () => { read({ shopId: this.match.params.shopId }).then((data) => { if (data.error) { this.setState({error: ...Read now
Unlock full access