-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
SSR classNames not matching when using Style Object #3124
Comments
Same here. I'm using in a project with |
I have a similar problem when using className + classNamePrefix.
Example: import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Select from 'react-select';
class Example extends PureComponent {
static propTypes = {
department: PropTypes.array,
}
static defaultProps = {
department: [
{ "value": "all", "label": "All" },
{ "value": "design", "label": "Design" },
{ "value": "accounting", "label": "Accounting" },
{ "value": "business", "label": "New Business" },
{ "value": "development", "label": "Development" },
]
}
render() {
const { department } = this.props;
return (
<Select
name="department"
className="select"
classNamePrefix="select"
options={department}
defaultValue={department[0]}
/>
);
}
}
export default Example; |
I also was having this issue. Giving it an |
Hi @wagnerjsilva and @andrevenancio we added the |
The instanceId doesn't fix it for me.
Without instanceId i'm getting the error: In another issue i learned that i have to set the instanceId. With id instanceId the prop id warning is away but now i'm getting the className prop warning. Is there something i'm missing? thanks |
Same here, I tried setting an instanceId and still getting the warning. Did you find a solution @bmsuseluda? |
Had the same issue but this resetId seemed to resolve the issue. This happens because of server and client id mismatch.
|
Hey @gwyneplaine I think you closed this too early… :/ |
Having the same issue on nextjs and styled components |
Having the same issue on nextjs, how can fix it? |
Still having the same issue |
Even though this REALLY isn't an ideal solution, it fixes the problem temporarily until the styles works when using SSR (Nextjs, etc) I've copied most of the styles not being applied to a This is a fix for people using
|
Having the same issue on Remix. Anyone have a fix? |
Hello,
I'm integrating react-select to my SSR implementation, and currently I'm having issues with classNames not matching:
Warning: Prop
className
did not match. Server: "css-1u7qna3" Client: "css-6xc8cw"My Select declaration is as follows:
The problem seems to happen when I try to use the styling object, as per the documentation below:
https://react-select.com/styles
I was wondering if someone else has experienced this issue and would care to help.
The text was updated successfully, but these errors were encountered: