Can anyone explain me how React-Router assembles the components together?
What I mean is: Take for example this code from the React-Router documentation ...
<Router history={browserHistory}>
<Route path="/" component={App}>
<Route path="about" component={About}/>
<Route path="users" component={Users}>
<Route path="/user/:userId" component={User}/>
</Route>
<Route path="*" component={NoMatch}/>
</Route>
</Router>
Let's say I enter the URL "/inbox/messages/" into the adressbar.
I guess it calls first the "App" component and incorporates that into the DOM-tree.
But how does it goes on?
They use they the "this.props.children" property.
const App = React.createClass({
render() {
return (
<div>
<h1>App</h1>
<ul>
<li><Link to="/about">About</Link></li>
<li><Link to="/inbox">Inbox</Link></li>
</ul>
{this.props.children}
</div>
)
}
})
But "App" has several children. Right?
How does it decide what it has to incorporate next? How does the algorithm work?