Router does not render children route component.
I'm trying to nest albums from user following the current url:
"/user/$userId/album/$albumId"
It does navigate, but it does not show the correct component(see the picture), it is stuck in the user pages, and does not show the album page.
Why does this happen?
My router is settled up as follows:
Thank you
2 Replies
like-goldOP•3y ago
Following the same logic on
react-router I reallized We need to created another index/main component for the path so it behaves also like an index:
So, in this case, what would be the best way to nest routes in tanstack/react-router?eager-peach•3y ago
I think the best way to go about this is to have the
userRoute just contain an <Outlet />, and then create a userIndexRoute that actually renders the Profile component. Let both userIndexRoute and userAlbumRoute be children of userRoute.