The following piece of code is causing the link to the product to return undefined:
<Col>
<Link to={`/product/${item.product}`}>
{item.name}
</Link>
</Col>
The culprit is on line 86 and is caused by an incorrect declaration. When we map through the cartItems, we try to access item.product, however, there is no property called product in the cartItems. To fix this issue, change line 86 to the following:
<Col>
<Link to={`/product/${item._id}`}>
{item.name}
</Link>
</Col>
So now, the path is correct like so: '/product/:id'
The following piece of code is causing the link to the product to return undefined:
The culprit is on line 86 and is caused by an incorrect declaration. When we map through the
cartItems, we try to accessitem.product, however, there is no property called product in thecartItems. To fix this issue, change line 86 to the following:So now, the path is correct like so:
'/product/:id'