T
TanStack3y ago
diverse-rose

Split router tree into multiple files

Is there any way to split the routerTree into multiple rootRoutes? We have a large application and this would mean that the whole routing tree has to be in one place and cant be split. I have tried to split it but it breaks the typesafety of the router. Any tips or ideas?
1 Reply
harsh-harlequin
harsh-harlequin3y ago
@hellboj my understanding is you can only have one root route, but you can have any number of parent-to-child route relationships. So I'd recommend doing a "blank" or placeholder root route and then changing your other "root" routes to branch off the root route as children and then build each child from there. Hopefully that makes sense.

Did you find this page helpful?