You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the pains I've experienced in SSR of Next.js is to realize responsive design without unnecessary DOM elements being rendered.
In this project, we have the same case.
Problems in universally rendered apps with conditional rendering in regard to the responsive layout
window.mediaQuery cannot be used since it's not available on server-side rendering and there would be a DOM tree mismatch issue.
Using CSS media query would result in rendering all of the elements regardless of whether they are used either on desktop or on mobile.
@pi0 @danielroe cc @addyosmani
One of the pains I've experienced in SSR of Next.js is to realize responsive design without unnecessary DOM elements being rendered.
In this project, we have the same case.
Problems in universally rendered apps with conditional rendering in regard to the responsive layout
window.mediaQuery
cannot be used since it's not available on server-side rendering and there would be a DOM tree mismatch issue.I think this article explains this well.
We managed to avoid rendering unnecessary DOM elements by using https://github.com/artsy/fresnel in the Next.js project.
@pi0 @danielroe Could you please suggest what to use in Nuxt.js? Thank you.
The text was updated successfully, but these errors were encountered: