React server mismatches: Prop `className` did not match.
See original GitHub issueBug report
Describe the bug
After upgrading from Next.js 9.0.5
to 9.2.2
we noticed that we are getting server mismatches for a lot of our components which never errored before. We also tried other versions (e.g. 9.1.x
, 9.2.x
, 9.3.x
) and all of them have the same problem.
To Reproduce
Please use this repository with easy reproducible error - https://github.com/voronianski/nextjs-server-mismatch-bug
The code of the example component is open-source UI library and you can find it here - https://github.com/sumup-oss/circuit-ui/blob/canary/src/components/Hamburger/Hamburger.js
Screenshots
Issue Analytics
- State:
- Created 3 years ago
- Reactions:14
- Comments:57 (8 by maintainers)
Top Results From Across the Web
Warning: Prop `className` did not match. when using styled ...
That error is showing you the class that is being created by your styled-components library on the server and how it is different...
Read more >Warning: Prop className did not match. #7322 - GitHub
It appears to be an issue that backend generates styled component but client doesn't get it/doesn't use it and instead of using server...
Read more >Fixing ClassName did not match error - DEV Community
babelrc in the root directory and configure it. Here's the config file. Restart your server and refresh your server and you should be...
Read more >Warning: Prop `className` did not match in Next.JS site with ...
Try installing babel-plugin-styled-components , then add a .babelrc file to the root of the project with the following configuration.
Read more >Our journey to make styled-components work with server-side ...
Warning: Prop `className` did not match. ... styled-components documentation mentions that there could be class name mismatches between client and server, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing as it’s a bug in your application and can be better solved in Discussions or on Discord!
I can confirm that with next 10 😢