TanStackT
TanStack15mo ago
6 replies
slow-yellow

layout route component get all child routes and context

Is it possible to create this structure
settings/
  route.tsx
  account.tsx
  company.tsx

use route.tsx as the layout but get all "child" routes and the context of them
in the route.tsx layout i want to loop over the children to create a navigation menu and get the context of those child components to create the label
export const Route = createFileRoute("/_app/settings/account")({
  context: () => ({
    getTitle: () => "Account",
  }),
  component: AccountSettings,
})
Was this page helpful?