Redirecting /admin/ to /admin/displays
Hi guys, quick question, but first a bit of context. I'm using admin.tsx as a layout route. admin.index.tsx is just a placeholder since the real entry point for /admin is admin.displays.tsx.
I want to redirect /admin/ to /admin/display. Is it okay to just add a loader in admin.index.tsx for the redirect, or is there a cleaner way to handle this in TanStack Router?
As much as possible, I’d like to skip that extra step and land directly on /admin/displays without needing the admin.index.tsx route just for the redirect.
2 Replies
subsequent-cyan•4w ago
throw the redirect in beforeLoad
there is no other way than redirecting
foreign-sapphireOP•4w ago
I see, thanks!