TanStackT
TanStack14mo ago
21 replies
implicit-coffee

About route groups/layouts with different wrapper layouts

Hey Router people!
I am currently experimenting with converting a Next.js project that has the following routing (example):

Grouped under (main) and has its own layout.tsx in the Next.js world. Let's say this layout renders a header
-
/

-
/about


Grouped under (cv) and has its own layout.tsx
- /$locale/cv

Basically, the first group of routes should share one layout, or even root(?):
__root.tsx
(main)/
  some-type-of-root-or-layout-that-renders-<Outlet />.tsx
  index.tsx
  about.tsx
(cv)/
  some-type-of-root-or-layout-that-renders-<Outlet />.tsx
  $locale.cv.tsx

How could I go about implementing this in TanStack Router?
Was this page helpful?