September 2018
Beginner
156 pages
3h 28m
English
The ordering of the <Route> components inside <Switch> matters because the <Switch> component looks for a matching <Route> sequentially, and once a <Route> matching the browser's URL is found, it stops the search. This behavior may not be desired and you may want to render another route listed inside <Switch>. However, it can be corrected by changing the order in which <Route> are listed in <Switch>:
In the following examples, some of the common mistakes in listing the <Route> components in <Switch> are mentioned:
Read now
Unlock full access