hupe1980 / gatsby-plugin-material-ui

Gatsby plugin for Material-UI with built-in server-side rendering support
MIT License
136 stars 24 forks source link

[Grid] Incorrectly SSRed #98

Open mwskwong opened 2 years ago

mwskwong commented 2 years ago

Note this only happens if the grid container contains multiple grid items of different sizes.

i.e. The plugin correctly SSR this:

<Grid container>
  <Grid item xs={6}/>
  <Grid item xs={6}/>
</Grid>

But not this

<Grid container>
  <Grid item xs={8}/>
  <Grid item xs={4}/>
</Grid>

The issue I found in the style of the grid container is somehow missing in the 2nd case, and hydration will not add the style back. The only way for it to be correctly rendered is to reload the page.

Workaround Hard coding the styles in the style prop