I'm working with Next.js and Tailwind, and to get some elements displaying correctly I need to put some style classes into <html> and <body>.
I did this to my MyApp
function MyApp({ Component, pageProps}: AppProps) {
useEffect(() => {
document.querySelector("html").classList.add("h-full");
document.querySelector("body").classList.add("h-full");
document.querySelector("#__next").classList.add("h-full");
});
return (
<Component {...pageProps} />
)
}
That's working... but I would like to know if there any other way of doing, or more elegant solution.