TanStackT
TanStack5mo ago
4 replies
wispy-olive

What is the correct way to set up these routes with a layout ?

Hi, I have a route called
vadashboard
and that route also has a
_layout
hierarchy goes as:
routes/
├── vadashboard.tsx              (Main route - client selector page)
├── vadashboard/
    ├── _layout.tsx                  (Layout wrapper for vadashboard routes)
    └── _layout/
        ├── index.tsx                (Default layout index)
        └── client_/                 (Dynamic client routes)
            └── $client/
                └── index.tsx        (Individual client dashboard page)


Basically what i want is that before we apply the layout, we have a first stop in the
/vadashboard
route is a dropdown where the user can select a client and once they select the client they get redirected.

Redirection is not an issue but every time the user clicks on the client, the route becomes
/vadashboard/client/Kf3x0Vh3yEaqxg2DTLcaDUjpCH0oF0xH
, but what's rendered is still just the
vadashboard.tsx
route
Was this page helpful?