Recursive routing (Seeing if tanstack router works for our project)
In our project we have recursive routes and I can't seem to find an example of it in the docs
This isn't our app but it gets the concept across
Imagine an app that shows you a person say '/person/$id'
Then on that page you can open a sub page in an outlet that shows the details of that first person's child
With out existing react-router we can do this and just keep opening subtrees
Can you do this in tanstack router and if so can you link me to where I can read about it?

4 Replies
absent-sapphire•8mo ago
we dont have recursive routes
absent-sapphire•8mo ago
you can use splat routes though https://tanstack.com/router/latest/docs/framework/react/guide/code-based-routing#splat--catch-all-routes
Code-Based Routing | TanStack Router React Docs
⚠️ Before You Start If you're using , skip this guide. If you are new to TanStack Router, please be aware that file-based routing is the recommended way to configure TanStack Router. If you're not sur...
absent-sapphireOP•8mo ago
At that point I suspect you lose type safety and can't autocomplete to different routes from one of those recursive routes?
person/1/person/2/hobbies or something like that
absent-sapphire•8mo ago
yes, there wont be autocomplete
cc @Chris Horobin any idea if this woud be possible in a typesafe manner?
can you please explain how you do it in react-router?