File-base router for dashboard project
When using file-based router in dashboard project, the whole project is basically in a layout, except the login page, which is generally a single-page component.
So here are a few solutions:
1. Wrap all pages with layout in __root.tsx, similar to the practice of the tanstak router reference code. In this case, the login page will also be wrapped in layout, which does not meet the actual requirements.
2. Change the layout component to _layout.tsx, after which all page file names should be prefixed with '_layout', except login.tsx, which can be independent of the login page, but the file organization will become miscellaneous.
Is there a better solution?
3 Replies
vicious-goldOP•2y ago
oh I've found a discussion with this, and I'm trying to understand it https://github.com/TanStack/router/discussions/1102
GitHub
Custom Layout for Specific Routes in tanstack/router · TanStack rou...
Hello tanstack/router community, I'm working on a React project where I'm using the File-Based routing feature of tanstack/router. I have a specific requirement for which I'm seeking so...
absent-sapphire•2y ago
What I do is have two layout routes.
_auth and _public.absent-sapphire•2y ago
GitHub
nv-rental-clone/src/routes at master · SeanCassiere/nv-rental-clone
Navotar with Tailwind and the Tanstack. Contribute to SeanCassiere/nv-rental-clone development by creating an account on GitHub.