Using React Grid System with Gatsby

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...


const Layout = ({ children }) => {
  return typeof window !== 'undefined' && (
    <ThemeProvider theme={theme}>
      <GlobalStyle />
      <SiteFooter />

export default Layout