September 2018
Beginner
156 pages
3h 28m
English
Consider the following code snippet:
<Switch> <Route path="/" component={LoginComponent} /> <Route path="/dashboard" component={DashboardComponent} /></Switch>If the browser's URL path is /dashboard, it would match the first <Route> with path / and the <Route> with path /dashboard would never be matched and rendered. To fix this, either include the exact prop or list the <Route> with path / as the last entry in <Switch>.
Read now
Unlock full access