FAQ | This is a LIVE service | Changelog

Skip to content

Use css instead of mediaQuery hook to show/hide Sidebar

Joe Adams requested to merge fix-sidebar-rendering-server into master

Using the useMediaQuery hook prevents the Sidebar from being included in the initial render and creates layout shift as it has to wait for a window value to become available after hydration using useEffect.

Switching to a CSS approach should be fine as JSS is calculated server-side and is available on the initial render.

Edited by Joe Adams

Merge request reports