T
TanStack9mo ago
rare-sapphire

Having two similar views in the same app

What is the best way to structure the routes in a react app using tanstack router to have two different views, they both sometimes use the same components and also have unique ones
4 Replies
other-emerald
other-emerald9mo ago
Hi I can help you
rare-sapphire
rare-sapphireOP9mo ago
we can either discuss it here or in private basically I have two views, a viewer and an admin I want to be able to redirect the user to one of the views based on the role fetched from the auth (I can just mock it for now) my biggest problem is how the routing is going to work, for example if I have a dashboard page, I want to have one for the viewer and one for the admin, but for the user in the path he'll only see "/dashboard" not something like "/admin/dashboard" can you help by giving me an example of a folder structure if you have done something similar before? @Minima Takashi
other-emerald
other-emerald9mo ago
yeah excuse me where are u from?
rare-sapphire
rare-sapphireOP9mo ago
Tunisia you?

Did you find this page helpful?