If I want to have more than one layout in my app, do I need to delete my main layout?
Answered
Common Ringed Plover posted this in #help-forum
Common Ringed PloverOP
So, right now I have /app/layout.tsx but I want to have two major sections of my app, one like /app/(no-auth) and /app/(auth). The no-auth pages will have very high traffic and I don't want to hit my auth controller api unnecessarily. Do I delete my app/layout.tsx and put one each in (no-auth) and (auth)?
Answered by Basset Bleu de Gascogne
you can solve that by creating separating layout Components: Instead of deleting your existing app/layout.tsx, you can create two new layout components, one for each major section of your app.
app/no-auth-layout.tsx & app/auth-layout.tsx.
Then you can assign routes to each layout.
If you don't understand, feel free to dm.
app/no-auth-layout.tsx & app/auth-layout.tsx.
Then you can assign routes to each layout.
If you don't understand, feel free to dm.
2 Replies
Basset Bleu de Gascogne
you can solve that by creating separating layout Components: Instead of deleting your existing app/layout.tsx, you can create two new layout components, one for each major section of your app.
app/no-auth-layout.tsx & app/auth-layout.tsx.
Then you can assign routes to each layout.
If you don't understand, feel free to dm.
app/no-auth-layout.tsx & app/auth-layout.tsx.
Then you can assign routes to each layout.
If you don't understand, feel free to dm.
Answer
Common Ringed PloverOP
Thanks! What do I do about my default page?