TanStackT
TanStack2y ago
4 replies
brilliant-lime

Nested folder routes

The folder structure is in the image. When navigating to /projects/{projectId} I am seeing the page that's rendered on /projects. What am I missing?

Why is the parent route of projectId in routeTree.gen.ts project and not root:
const ProjectsRouteRoute = ProjectsRouteImport.update({
  path: '/projects',
  getParentRoute: () => rootRoute,
} as any).lazy(() =>
  import('./routes/~projects/~route.lazy').then((d) => d.Route),
)

const ProjectsProjectIdRouteRoute = ProjectsProjectIdRouteImport.update({
  path: '/$projectId',
  getParentRoute: () => ProjectsRouteRoute,
} as any).lazy(() =>
  import('./routes/~projects/~$projectId/~route.lazy').then((d) => d.Route),
)
image.png
Was this page helpful?