smooth-code / smooth.js

Code driven CMS powered by GraphQL & React.
MIT License
26 stars 10 forks source link

Fix className mismatch between server and client #11

Closed vripoche closed 5 years ago

vripoche commented 5 years ago

When we use the Emotion css prop in component, the following warning appears in console (dev mode):

react-dom.development.js:506 Warning: Prop `className` did not match. Server: "Headline__Container-amo8ay-1 sc-lhVmIH gLqGDj" Client: "Headline__Container-amo8ay-1 sc-iAyFgw cYlwyx"

Example in code base:

<Container css={css`background-color: red;`}>
...
</Container>

Despite this, the CSS are well applied.

gregberge commented 5 years ago

Yeah I know, I have this issue in a lot of projects but the error only occurs in development. I think it is not a big deal, but yeah it is still problematic.

gregberge commented 5 years ago

Should be fixed now.