Open zzkaqq opened 8 months ago
我也遇到这个问题
I am also dealing with this issue; it has disrupted my work for over three days.
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000
Binaries:
Node: 18.17.0
npm: 9.6.7
Yarn: 3.2.4
pnpm: 8.6.10
Relevant packages:
next: 13.1.6
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
"antd": "5.9.4"
had this too with nextjs and app router, that cause styles blinking on Antd components, for solve this problem you can extractStyle() inside a ".css" file and import the css file
had this too with nextjs and app router, that cause styles blinking on Antd components, for solve this problem you can extractStyle() inside a ".css" file and import the css file
can you please show an example of this?
这个问题没有解决方法吗?
had this too with nextjs and app router, that cause styles blinking on Antd components, for solve this problem you can extractStyle() inside a ".css" file and import the css file
can you please show an example of this?
You can find example here. If styles will be empty pay attention to versions of packages. https://ant.design/docs/react/server-side-rendering#whole-export
Issue related to package version. There is the version number without bug with empty styles. https://github.com/ant-design/static-style-extract/issues/3
根据官方示例:
控制台打印:
实际渲染结果:
框架:nextjs@14.0.0 模式:APP Router antd:5.10.2