Use css instead of mediaQuery hook to show/hide Sidebar
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