Using @theme-ui/match-media
's useResponsiveValue
hook in Gatsby causes the build to fail, due to its use of window.matchMedia
.
I'd normally add a typeof window === 'undefined'
check, but am not allowed to conditionally call a hook. Is there an alternative userland solution for this that I'm not thinking of?
I could add the check to the hook - is returning breakpoints[0]
a sensible default?