react router tutorial medium

Solutions on MaxInterview for react router tutorial medium by the best coders in the world

showing results for - "react router tutorial medium"
Isabell
07 Oct 2020
1<Route path='/roster'/>
2// when the pathname is '/', the path does not match
3// when the pathname is '/roster' or '/roster/2', the path matches
4// If you only want to match '/roster', then you need to use
5// the "exact" prop. The following will match '/roster', but not
6// '/roster/2'.
7<Route exact path='/roster'/>
8// You might find yourself adding the exact prop to most routes.
9// In the future (i.e. v5), the exact prop will likely be true by
10// default. For more information on that, you can check out this
11// GitHub issue:
12// https://github.com/ReactTraining/react-router/issues/4958