C
C
c00ldev2019-12-09 14:53:26
React
c00ldev, 2019-12-09 14:53:26

Why is match.params undefined in the component?

Why is match.params undefined in the Details component? How to make the details page correctly display product information?
https://codesandbox.io/s/young-cloud-7qo8

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2019-12-09
@c00ldev

I don't see any props being thrown into the Details component here.
Change to

<Route path="/goods/:id" render={(props) => <Details {...props} goods={goods} />} />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question