How i can use multiples layouts
Answered
Barbary Lion posted this in #help-forum
Barbary LionOP
Im wanna building a different layout for login page, but im receive a message error: Hydration failed because the initial UI does not match what was rendered on the server.
Answered by B33fb0n3
you can create multiple root layouts [by doing this](https://nextjs.org/docs/app/building-your-application/routing/route-groups#creating-multiple-root-layouts):
(see attached - or click link).
And then add inside each layout your own layouts:
(see attached - or click link).
And then add inside each layout your own layouts:
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>
{/* Layout UI */}
<main>{children}</main>
</body>
</html>
)
}
7 Replies
you can create multiple root layouts [by doing this](https://nextjs.org/docs/app/building-your-application/routing/route-groups#creating-multiple-root-layouts):
(see attached - or click link).
And then add inside each layout your own layouts:
(see attached - or click link).
And then add inside each layout your own layouts:
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>
{/* Layout UI */}
<main>{children}</main>
</body>
</html>
)
}
Answer
Can you send your code also?
Barbary LionOP
Now I can't, I'm not at home, but later I will send the structure of my project and also the code
Barbary LionOP
In this case, I would like to have the /login/cliente route and the /login/admin route
then you only need to do this: https://nextjs-forum.com/post/1302012822909227078#message-1302013629486600203
Barbary LionOP
Thanks for your help guys, I managed to solve the problem