Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js - className doesn't match from Server to Client #495

Open
redbaron76 opened this issue Mar 13, 2022 · 5 comments
Open

Next.js - className doesn't match from Server to Client #495

redbaron76 opened this issue Mar 13, 2022 · 5 comments

Comments

@redbaron76
Copy link

In 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 "

@FunctionDJ
Copy link

FunctionDJ commented Apr 10, 2022

I'm getting a very similar error:
Warning: Prop 'id' did not match. Server: "svg-inline--fa-title-yASNLozqHYmH" Client: "svg-inline--fa-title-dcqRQi73aEeT"
This only happens when i pass a title prop that's not falsy though 🤔 (maybe related to default props since that one is empty string i.e. the only falsy value that's allowed?)
The id prop doesn't seem to cause this issue. Very odd.

@robmadole
Copy link
Member

@redbaron76 @FunctionDJ have you tried specifying titleId? I don't think we have this documented but the component should support that now with 0.1.18.

@FunctionDJ
Copy link

@robmadole i'm using neither ids nor titleIds :V

@robmadole
Copy link
Member

@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.

@ivan-kleshnin
Copy link

ivan-kleshnin commented Apr 22, 2022

I have the same warning about the pulse prop:

Prop `className` did not match. 
Server: "svg-inline--fa fa-spinner fa-pulse " 
Client: "svg-inline--fa fa-spinner "

With spin working fine in the same setup:

<FontAwesomeIcon
  ...
  pulse={pulse}
  spin={spin}
  ...
/>

It might be related to the unfinished internal migration from pulse to spinPulse but I'm not sure.
Should I create a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants