-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Classname issue in SSR #67
Comments
Hi Juan, on prod issue does not show up because react-dom shows warnings only in dev mode – it's still there. |
Do you want me to close this issue and follow this in the other ticket? |
Nope, let's leave this open so that anyone else can join the conversation |
Currently I experience the very same issue with a custom avatar component based upon Mantine's avatar. After page reload I get this error and the styles from avatar are broken. This happens with Mantine |
From FAQ: Next.js SSR does not work/while page is loading there are no styles/styles do not work without JavaScript
|
@rtivital I’m using Next |
Well, no idea then, template works as expected for me |
I have took a look at this page in Next Docs and bingo. My problem was a border color, which I was setting dynamically like this: <MantineAvatar
...
styles={theme => ({
root: {
border: `2px solid ${getRandomColor(theme.color)}`,
}
})}
>
... The fix is to combine const [color, setColor] = React.useState("");
const theme = useMantineTheme();
React.useEffect(() => {
setColor(getRandomColor(theme.colors));
}, []); |
Hello there 👋🏻
Following the example from the theme selector, I saw an issue with the
classname
while using SSRIt seems hydration is not working as expected in the
<ActionIcon />
component.Tech notes:
Cheers
edit: on prod build the error is not there, only reproducible on dev mode 😄
The text was updated successfully, but these errors were encountered: