T
TanStack11mo ago
absent-sapphire

Is there an equivalent of SolidStart's renaming index.tsx option?

Hey folks, super quick question that I can't seem to find in the docs: Is there a way to rename index.tsx files within a nested file route? For example, SolidStart's file router has an option to rename these index files: https://docs.solidjs.com/solid-start/building-your-application/routing#renaming-index
|-- routes/ // example.com
|-- socials/
|-- (socials).tsx // example.com/socials
|-- routes/ // example.com
|-- socials/
|-- (socials).tsx // example.com/socials
Is there an option or equivalent way to achieve this in Router?
4 Replies
foreign-sapphire
foreign-sapphire11mo ago
no we don't have this you can create a feature request as a gh issue another option are virtual file routes those allow you arbitrarily named files
foreign-sapphire
foreign-sapphire11mo ago
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.
From An unknown user
From An unknown user
absent-sapphire
absent-sapphireOP11mo ago
No worries, I'll file one then! For reference, I personally like using directory file based routing, I like how that keeps all my routes organized. BUT I dislike having lots of index.tsx files when I try to navigate around the project, especially via the command palette in VSCode. Renaming these index files is super nice for that type of orgnization.
absent-sapphire
absent-sapphireOP11mo ago
GitHub
Option to rename index files · TanStack router · Discussion #2624
When working with file-based routing, the default way to create a path that matches the directory name is to create an index.tsx file within that directory: . └── /routes/ ├── /posts/ │ └── index.t...

Did you find this page helpful?