Answer the question
In order to leave comments, you need to log in
How to properly organize routing in an application?
Routing is organized through react-router-dom. The structure is the following:
<Route exact path="/goods" component={ Goods } />
<Route path="/goods/:id" component={ Details } />
<Route exact path="/new" component={ NewGood } />
<Route exact path="/goods/new" component={ NewGood } />
Answer the question
In order to leave comments, you need to log in
Your answer to the question in the documentation
I'll explain a little.
1. Create a route at the "/goods" url, where the Goods component will be rendered (you have already created it)
2. In the Goods component, organize a new routing.
The order is important, emnip:
<Route exact path="/goods" component={ Goods } />
<Route exact path="/goods/new" component={ NewGood } />
<Route path="/goods/:id" component={ Details } />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question