[WIP] Fix Warning: Prop className
did not match
#7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tries to solve the warning
If you run it locally do some changes in the code, refresh the page you will start seeing the error after some interaction.\
The changes are based on: https://medium.com/javascript-in-plain-english/ssr-with-next-js-styled-components-and-material-ui-b1e88ac11dfa
I cloned the repo linked there and it works as expected
I tried to make it as close as possible as the project in the example repository. The difference is how babel is used, the example project defined
.babelrc
, but we havebabel.config.js
I also followed the comments on this issues of how to properly add the plugin:
styled-components/babel-plugin-styled-components#78 and tried both names for the plugin: "babel-plugin-styled-components" & "styled-components", but nothing worked so far.
My guess is that somehow the plugin is not correctly loaded, as if I remove the plugin in the example repo that I cloned, the error starts showing again after the code is changed and the page is refreshed.