ant-design / cssinjs

https://ant-design.github.io/cssinjs
MIT License
236 stars 59 forks source link

Prop `className` did not match. #52

Open terminalqo opened 1 year ago

terminalqo commented 1 year ago

Hi, I'm using nextjs@13 + antd@5.

And browser show this in devtool:

Warning: Prop `className` did not match. 

Server: "ant-menu-overflow ant-menu ant-menu-root ant-menu-horizontal ant-menu-dark css-dev-only-do-not-override-1dsa5t3" 

Client: "ant-menu-overflow ant-menu ant-menu-root ant-menu-horizontal ant-menu-dark css-dev-only-do-not-override-t98trl"

Which I think there are something wrong with this:

image

terminalqo commented 1 year ago

image So, hash function may run twice, once in server, once in client ?

mitya-kocherga commented 1 year ago

Hi there with next js v12.2.2 and ant v5 it also reproducible

cassianpry commented 1 year ago

Hello with "next": "13.0.4" and ant v5 also reproducible

cong1223 commented 1 year ago

This is a serious bug

immdraselkhan commented 1 year ago

Same issues. ☹️

bombillazo commented 1 year ago

Any update on this?

markpedong commented 11 months ago

const ProLayout = dynamic( () => import("@ant-design/pro-components").then((com) => com.ProLayout), { ssr: false } );

if you are using Pro Layout component, then you can use this code. It would defeat the purpose of using SSR.

hstarorg commented 11 months ago

m

koliader commented 9 months ago

I found website with solution

yasz commented 8 months ago

any update?

manzaloros commented 7 months ago

I'm also having this error when using AntD v5 and Remix v2, loading the AntD CSS using the "whole export" approach.

bombillazo commented 7 months ago

This issue happens with both "whole export" and "inline-styles".

yanugto commented 4 months ago

const ProLayout = dynamic( () => import("@ant-design/pro-components").then((com) => com.ProLayout), { ssr: false } );

if you are using Pro Layout component, then you can use this code. It would defeat the purpose of using SSR.

this resolved my problem,thanks.

Minf97 commented 2 months ago

next14 have the same problem

yjw0628 commented 1 month ago

const ProLayout = dynamic( () => import(“@ant-design/pro-components”).then((com) => com.ProLayout), { ssr: false } );

如果您使用的是 Pro Layout 组件,则可以使用此代码。这将破坏使用 SSR 的目的。

This is a bad idea

SamChami commented 1 month ago

I'm also having this error when using AntD v5 and Remix v2, loading the AntD CSS using the "whole export" approach.

I am also seeing this in AntD 5 and Remix 2