Closed nivethan-me closed 3 weeks ago
Hi @nivethan-me, Route
component can't use children when the component
prop is given, they are mutually exclusive. What might solve your problem is this:
return (
<Router>
<Route path="/app" nest>
<Route path="users/:id" nest>
<Route path="/" component={SingleUser} />
<Route path="/orders" component={Orders} />
</Route>
</Route>
</Router>
);
I'm following the docs on Route nesting and having difficulties on understanding how it really works
https://github.com/molefrog/wouter?tab=readme-ov-file#route-nesting
Steps to Reproduce:
pnpm create vite
).Expected Behavior
The
Orders
component should render on the path /app/users/1/ordersActual Behavior
The
SingleUser
component renders instead of theOrders
component. even though the docs mention following