Next.js - className doesn't match from Server to Client
See original GitHub issueIn Next.js there’s a mismatch between the classes printed in className
on the Server and the ones in Client.
The Client adds a space at the end of the concatenation of classes, causing the mismatch.
In example:
Warning: Prop className did not match. Server: "svg-inline--fa fa-mug-saucer" Client: "svg-inline--fa fa-mug-saucer "
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 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 >Solving the Styled Components Warning in Next.JS with Babel
Warning: Prop `className` did not match. Server: “fs-fdsf” Client: “sd-dfasj”. The combination of Next.JS and Styled Components is truly ...
Read more >Prop `className` did not match. Server.... react js next js ...
[Solved]-Prop `className` did not match. Server.... react js next js-Reactjs. Search. score:0. const style = (<style jsx global className='theme'>{` body ...
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
@FunctionDJ ah, sorry we’ve got two different bugs here. Will you create an issue with your error separate from this? Your issues is not related to the OP. I think I have a fix for your issue once you do that.
@redbaron76 it’s the extra space that is causing a problem for you. We’ll see if we can get that taken care of.
I have the same warning about the
pulse
prop:With
spin
working fine in the same setup:It might be related to the unfinished internal migration from
pulse
tospinPulse
but I’m not sure. Should I create a new issue?