Answer the question
In order to leave comments, you need to log in
How to link to a specific article in react?
Tell me about routers, please.
There is a page with articles, you need to make it so that you can click on the title of the article and go to the page with this article. How to do it in react?
Answer the question
In order to leave comments, you need to log in
Just in the container route of (for example) News, add /news/:id
More details in the documentation with examples
(a variant using react-router)
You make a route with a parameter, for example: , where the parameter is the variable_name after the colon, in this example - id
In the Article component, you have access to the ID through
Next as you like, for example, in componentDidMount make a request for this article and show her..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question