Next.js Discord

Discord Forum

Using different css classes on the html/body tags depending on the route

Answered
MikeyB posted this in #help-forum
Open in Discord
Next.js must have a root layout which must contain html/body tags, but I want to specify className attributes from within my group layouts, how would I go about this? Basically just want to add h-full in some cases!
Answered by MikeyB
ah never mind, I wasn't returning the html from my layout function and the error suggesting no root layout made me think I have to have an actual root layout, and not just one in the tree of the page... Added a return (...) round the layout and it works!
View full answer

2 Replies

ah never mind, I wasn't returning the html from my layout function and the error suggesting no root layout made me think I have to have an actual root layout, and not just one in the tree of the page... Added a return (...) round the layout and it works!
Answer
Spectacled bear
If this is fixed, please mark it resolved.