react-router-tutorial
react-router-tutorial copied to clipboard
IndexRoute precise description
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?
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.