hupe1980 / gatsby-plugin-material-ui

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

2.0.0-alpha.6 flashing unstyled componentts #18

Closed alanpog closed 5 years ago

alanpog commented 5 years ago

Tested only with the gatsby-material-kit-react starter, so not sure how specific to its config (material-ui version for example) this issue is. But one can easily toggle between having the unstyled flash or not by switching between @next (2.0.0-alpha.6) and @latest (1.2.4).

I'm afraid this may bite more people than necessary despite the alpha label because:

Related discussion: https://github.com/creativetimofficial/material-kit-react/issues/51#issuecomment-489219402

oliviertassinari commented 5 years ago

@alanpog The Gatsby example on Material-UI side doesn't use this plugin with v3. It does use it with v4. I would encourage to replicate the example.

alanpog commented 5 years ago

@oliviertassinari indeed I can confirm that the same example with @next works fine with material-ui v4. That's great. However, given that v4 is still in beta it'd probably help other people like me if the docs have a short mention that for v3 one should use @latest instead.

oliviertassinari commented 5 years ago

@hupe1980 What do you think of adding a peer dependency on Material-UI in https://github.com/hupe1980/gatsby-plugin-material-ui/blob/237d40476c7a5345167c775a6c2b2c42cc66980f/package.json#L23 ?

hupe1980 commented 5 years ago

Yes, that's a good point. I adjusted it