Open
Description
$active
in routes defined from a 2nd level of nested Router
onwards is always undefined
, resulting in Route
's slot / component never rendering.
<p>
<a href="/">Home</a> |
<a href="/nest-1">nest-1</a> |
<a href="/nest-1/nest-2">nest-2</a> |
<a href="/nest-1/nest-2/nest-3">nest-3</a>
</p>
<Router>
<Route path="/">
<div>home</div>
</Route>
<Route path="/nest-1/*">
<div>nest-1</div>
<Router>
<Route path="/">nest-1 index</Route>
<Route path="/nest-2/*">
<div>nest-2</div>
<Router>
<!-- never renders -->
<Route path="/">nest-2 index</Route>
<!-- never renders -->
<Route path="/nest-3/*">
<div>nest-3</div>
</Route>
</Router>
</Route>
</Router>
</Route>
</Router>
(I'd post a codesandbox link, but Codesandbox has an issue with the mjs module exported by navaid
)
In the above example the Route
containing nest-2 index
will always have $active === undefined
.
This seems odd since each Router
gets its own instance of navaid, and the first nested Router
works without issue.
Am I misunderstanding how to define routes, or am I not understanding how navaid works?
Metadata
Metadata
Assignees
Labels
No labels