V
V
Vladimir Golub2019-08-07 16:00:11
React
Vladimir Golub, 2019-08-07 16:00:11

How to correctly pass a parameter to Link to open the desired page?

There are paths:
/nazvanie-novosti-type-1
/nazvanie-novosti-type-2
/nazvanie-novosti-type-3
and there are a lot of them.
They can refer to multiple components:
Component1
Component2
Component3
My Route at the moment

<Route path=':param'  component={ ComponentWrap }/>

Wrote a wrapper component for the other 3.
Link to follow the link How do I now know what type of page to show the user ? Need to pass a parameter to Link ?
<Link to='/nazvanie-novosti-type-1' />

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2019-08-07
@RazerVG

How do I now know what type of page to show the user?

Request data from the server and find out what type of news. Depending on the type, render the desired component.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question