hydration error
Answered
Swedish White Elkhound posted this in #help-forum
Original message was deleted.
Answered by fuma
Why
Therefore, your project structure will be like:
/dashboard also contains a html tag? If you want the layouts to be different, you can use [route groups](https://nextjs.org/docs/app/building-your-application/routing/route-groups).Therefore, your project structure will be like:
layout.tsx: Root layout, contains providers and html tag(home)/layout.tsx: Layout of pages under (home), including a navbar/links(home)/page.tsx: The home page at /(home)/about.tsx: The about page at /about(dashboard)/dashboard/layout.tsx: Layout of pages under (dashboard)(dashboard)/dashboard/page.tsx: The dashboard page at /dashboard33 Replies
Can you provide some code or a GitHub repo?
Swedish White Elkhound
sure
Swedish White Elkhound
wait i forgot to git push
ok there
it only shows when you go to /dashboard
@fuma
i wanted the layout to be different for /dashboard
Why
Therefore, your project structure will be like:
/dashboard also contains a html tag? If you want the layouts to be different, you can use [route groups](https://nextjs.org/docs/app/building-your-application/routing/route-groups).Therefore, your project structure will be like:
layout.tsx: Root layout, contains providers and html tag(home)/layout.tsx: Layout of pages under (home), including a navbar/links(home)/page.tsx: The home page at /(home)/about.tsx: The about page at /about(dashboard)/dashboard/layout.tsx: Layout of pages under (dashboard)(dashboard)/dashboard/page.tsx: The dashboard page at /dashboardAnswer
Swedish White Elkhound
Ohhh
My layout.js in the app folder
Your layouts will be nested, which means the same page contains multiple html tags.
that's why you got the error
@fuma Your layouts will be nested, which means the same page contains multiple html tags.
Swedish White Elkhound
it works but how do i make /dashboard not show the navbar instead i want it to show the sidebar
Add the sidebar to your dashboard layout
Swedish White Elkhound
some reason it still shows the navbar
Swedish White Elkhound
do i remove the html and body tag?
Remove these tags from where?
Swedish White Elkhound
Nevermind
No layouts other than
Read [Route Groups](https://nextjs.org/docs/app/building-your-application/routing/route-groups) for further information
(home)/layout.tsx includes the navbar(dashboard)/layout.tsx is where you put the sidebarRead [Route Groups](https://nextjs.org/docs/app/building-your-application/routing/route-groups) for further information
Swedish White Elkhound
so do i keep the navbar where it is?
im new to next js
@fuma Why `/dashboard` also contains a `html` tag? If you want the layouts to be different, you can use [route groups](https://nextjs.org/docs/app/building-your-application/routing/route-groups).
Therefore, your project structure will be like:
`layout.tsx`: Root layout, contains providers and html tag
`(home)/layout.tsx`: Layout of pages under (home), including a navbar/links
`(home)/page.tsx`: The home page at /
`(home)/about.tsx`: The about page at /about
`(dashboard)/dashboard/layout.tsx`: Layout of pages under (dashboard)
`(dashboard)/dashboard/page.tsx`: The dashboard page at /dashboard
Basically, just use the above structure I've sent
Your navbar is currently in the root layout, you have to move it to the new layout under your "home" route group
Your navbar is currently in the root layout, you have to move it to the new layout under your "home" route group
Swedish White Elkhound
hhhh
ohhh
i get it now
so i create a folder in the app folder name home
and add layout.js
it's a route group, you have to wrap the folder name in parenthesis, read the docs above
@fuma it's a route group, you have to wrap the folder name in parenthesis, read the docs above
Swedish White Elkhound
okay thanks
i got it now