The configuration isn't about the routing (despite the name) but more about the layouts driven by paths.
So, with this configuration:
<Route name="dashboard" handler={availableRoutes.Dashboard}>
<Route name="dashboard-child" handler={availableRoutes.DashboardChild} />
</Route>
It is saying that dashboard-child
is to be embedded inside dashboard
. How this works is that if dashboard
has something like this:
<div><h1>Dashboard</h1><RouteHandler /></div>
and dashboard-child
has:
<h2>I'm a child of dashboard.</h2>
Then for the path dashboard
there is no embedded child due to no matching path, resulting in this:
<div><h1>Dashboard</h1></div>
And for the path dashboard/dashboard-child
the embedded child has a matching path, resulting in this:
<div><h1>Dashboard</h1><h2>I'm a child of dashboard.</h2></div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…