
When I was usingreact router for the first time I usedpath instead ofexact path as props in component.
<Router><Switch><Routeexactpath="/"><Home/></Route><Routepath="/about"><About/></Route><Routepath="/dashboard"><Dashboard/></Route></Switch></div></Router>
In the above code when one replacesexact path topath it will match every path starting with '/', since the is inside the so, it will match the first path and don't check for the other matches.
The above code after removingexact from the will always show component and ignore or .
If one doesn't want to useexact path then the below code will work
<Router><Switch><Routepath="/about"><About/></Route><Routepath="/dashboard"><Dashboard/></Route><Routepath="/"><Home/></Route></Switch></div></Router>
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse