React Router: IndexRoute

Share this video with your friends

Send Tweet

IndexRoute allows us to define a default child component to be rendered at a specific route when no other sub-route is available.

sk29110
sk29110
~ 8 years ago

After your change /about path should not be existed right?

kevin
kevin
~ 8 years ago

If you follow this video, and at the end click on the link created to go to about, rather than clicking the link for home, you will get a routing error. fyi, you need to add a Route for the about link to go to.

Michal Svorc
Michal Svorc
~ 7 years ago

<IndexRoute /> is no longer supported in react-router v4, try using <Switch /> instead