Replies: 1 comment 1 reply
-
| 
         This is a great discussion. But it would be better placed in the Router repo. This repo is about bootstrapping applications. The Router repo is for discussions about the best application of the router.  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone 👋
I’ve set up a TanStack Start app using:
npm create @tanstack/start@latestSetup Steps I followed
Goal
I want to have two main layouts in my project to maintain a consistent design structure:
AuthLayout→ For all authentication-related pages (Login, Signup, etc.)DashboardLayout→ For all protected pages (after login)Desired Routing Structure
Auth Routes
Dashboard Routes
The Main Problem
I’m struggling to conditionally render the correct layout (either
AuthLayoutorDashboardLayout) on the base route(/)depending on whether the user is authenticated.Basically:
AuthLayoutwith Login pageDashboardLayoutwith Dashboard pageI’ve tried multiple approaches but couldn’t make it work with
createFileRouteWhat I Need Help With
Could someone please explain or show an example of how to structure my files and routes to achieve this layout setup in TanStack Start?
You can just mimic user authentication with a boolean constant for now.
Thanks in Advance!
Beta Was this translation helpful? Give feedback.
All reactions