Nextjs Layout
Unanswered
New Guinea Freshwater Crocodile posted this in #help-forum
New Guinea Freshwater CrocodileOP
If I have a layout that contains a navbar and then once a user logins in and is viewing auth pages - I would like for it to ignore the original layout and only look at the layout in its folder - is this possible? I know I can check the auth state in the main layout and either switch it or disable it here. But was wondering If there was a better way and I wask missing something? Thanks in advance! :))
2 Replies
@New Guinea Freshwater Crocodile If I have a layout that contains a navbar and then once a user logins in and is viewing auth pages - I would like for it to ignore the original layout and only look at the layout in its folder - is this possible? I know I can check the auth state in the main layout and either switch it or disable it here. But was wondering If there was a better way and I wask missing something? Thanks in advance! :))
yes use route group for this
app
layout.tsx <-- root layout
(auth)
layout.tsx
login/page.tsx
(with-navbar)
layout.tsx <-- render navbar here
other-route/page.tsx
app
layout.tsx <-- root layout
(auth)
layout.tsx
login/page.tsx
(with-navbar)
layout.tsx <-- render navbar here
other-route/page.tsx