You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi folks, this is very nice library for doing grid!
Just wanted to help to other people who are trying to set up with gatsby:
To add custom configuration you need 2 files:
gatsby-browser.js
import{setConfiguration}from'react-grid-system';// Here we configure gridsetConfiguration({maxScreenClass: 'xl',defaultScreenClass: 'xl'});
gatsby-ssr.js
const{ setConfiguration }=require('react-grid-system');exports.onPreRenderHTML=()=>{// Here we configure gridsetConfiguration({maxScreenClass: 'xl',defaultScreenClass: 'xl'});};
Also you need to wrap all components in <ScreenClassProvider /> so pages look exactly the same and layout does not get re-rendered after initial hydration.
I think this can be documented in examples or in README.md but took me some time to set it up.
If there are any questions feel free to ask!
The text was updated successfully, but these errors were encountered:
@davidvenin same solution should technically work for NextJS (though I did not test). in getInitialProps do the same thing as I did in gatsby-ssr.js and it should do the trick.
Hi folks, this is very nice library for doing grid!
Just wanted to help to other people who are trying to set up with gatsby:
To add custom configuration you need 2 files:
gatsby-browser.js
gatsby-ssr.js
<ScreenClassProvider />
so pages look exactly the same and layout does not get re-rendered after initial hydration.I think this can be documented in
examples
or in README.md but took me some time to set it up.If there are any questions feel free to ask!
The text was updated successfully, but these errors were encountered: