Skip to content

PlaceOrderScreen.jsx Product Link Returns Undefined #53

Description

@canizeus94

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions