TanStackT
TanStack4w ago
7 replies
worthy-azure

Trying to create pathless route with nested folders

This is the kind of folder structure I am going for. This is achievable with Next.js but not too sure if I can achieve this with tanstack router.
I wanted my urls to be /email or /phone only. The reason why I still have (lobby)/index.tsx is to handle redirection to either /email or /phone.
└── routes
    └── (lobby)
        ├── email
        │   └── index.tsx
        ├── index.tsx
        └── phone
            └── index.tsx

If I am not mistaken, the official way to achieve this is to go for flat routing like this
└── routes
    └── (lobby)
        ├── email.tsx
        ├── index.tsx
        └── phone.tsx

But what if I want to have further nested routes within /email or /phone?
Was this page helpful?