hydration error
Answered
Vizsla 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?
Vizsla
sure
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
Vizsla
Ohhh
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.
Vizsla
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
Vizsla
some reason it still shows the navbar
Vizsla
do i remove the html and body tag?
Remove these tags from where?
Vizsla
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
Vizsla
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
Vizsla
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
i got it now