Rootlayout navbar and footder still showing at the DashboardLayout after the user login in app router nextjs 13

50 views Asked by At

I am working on a project using the nextjs app router where I have a dashboardlayout inside the dashboard folder that only login user can access but the Rootlayout navbar and footer still show at the dashboardlayout after login. how can I fix this. where can wrap the application with AuthProvider from context and firbase for auth

1

There are 1 answers

0
Will 40 On

That is intended behavior of Next JS layouts. If you don't want the RootLayout's navbar and footer to apply to all pages then you shouldn't put it there. You should only apply that layout to the pages that you are using it on.