D
D
Daniil Sugonyaev2018-10-31 14:33:48
JavaScript
Daniil Sugonyaev, 2018-10-31 14:33:48

How to work with an unknown number of intermediate pages in react-router?

For example, there is the following path /zhenshchinam/verkhniaia-odezhda/mekhovye-zhilety/art0916046. It is not known how many intermediate pages to /art0916046. Now I check like this:

<Route exact path='/:name/:name/:name/art:id' component={ ProductCard } />

However, I think there is some syntax that allows you to do this more correctly.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2018-11-28
@modestguy

Perhaps this dock will help you: https://tylermcginnis.com/react-router-nested-routes/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question