React19 中使用 antd5 ,按照官网的教程加入了兼容模式 import '@ant-design/v5-patch-for-react-19';
,但是一直报错。
报错内容是: Module not found: Can't resolve 'antd/lib/unstable-set-render' in xxx
检查了下antd/lib目录下,的确没有 unstable-set-render。
希望不报错
React19 中使用 antd5 ,按照官网的教程加入了兼容模式 import '@ant-design/v5-patch-for-react-19';
,但是一直报错。
报错内容是: Module not found: Can't resolve 'antd/lib/unstable-set-render' in xxx
检查了下antd/lib目录下,的确没有 unstable-set-render。
希望不报错
找到原因了。
是因为 rspack 配置的 rspackExperiments: { import: [{ libraryName: 'antd', style: true }] },