TanStackT
TanStack2y ago
8 replies
standard-azure

Default children route

I have a root to edit my office /offices/$id/edit

This root as 3 children roots:

const routeTree = RootRoute.addChildren([
  // ...
  // '/offices/$id/edit'
  OfficeEditRoute.addChildren([ 
    OfficeEditDescriptionRoute, // '/'
    OfficeEditFeaturesRoute, // '/features'
    OfficeEditImagesRoute, // '/images'
  ]),
  // ...
]);


The goal is to show the right form depending of the route (this children are rendered in an <Outlet />).

How do I make it so that the OfficeEditDescriptionRoute is the default children route, so that when the user is on /offices/$id/edit, the Description Route is shown. The other route would be shown based on the path (with the use of navigation).

Thanks
Was this page helpful?