Total nightmare trying to use React Grid System with Gatsby.
Issue: on page load window is undefined so the grid defaults to the size defined. So loading mobile pages results in desktop view etc.
Resolution: adding window
check before Layout load.
More to come...
layout.js
const Layout = ({ children }) => {
return typeof window !== 'undefined' && (
<ThemeProvider theme={theme}>
<GlobalStyle />
<SiteHeader
siteTitle={data.site.siteMetadata.title}
/>
{children}
<SiteFooter />
</ThemeProvider>
)
}
export default Layout