react-router-tutorial icon indicating copy to clipboard operation
react-router-tutorial copied to clipboard

IndexRoute precise description

Open zcserei opened this issue 9 years ago • 1 comments
trafficstars

In step 8, the following is said about IndexRoute:

Notice how the IndexRoute has no path. It becomes this.props.children of the parent when no other child of the parent matches, or in other words, when the parent's route matches exactly.

I think that's not entirely precise, as, for example, /something also matches the index. Is that expected behaviour? Should this be explicitly overwritten by handling unhandled routes?

zcserei avatar Aug 30 '16 20:08 zcserei

From my understanding the path they are talking about here is the path="/" witch in my opinion does not match exactly with what you are suggesting path="/something". If you have a better way of formulating the sentence you are welcome to give it a shot 👍

IndexRoute is hard to grasp and as they mention in the same lesson "Index routes can twist people's brains up.." so it is not an easy concept to understand or even explain.

Andersos avatar Oct 12 '16 20:10 Andersos