diff --git a/docs/react/use-with-next.en-US.md b/docs/react/use-with-next.en-US.md index ba1765750316..4d88094df7f8 100644 --- a/docs/react/use-with-next.en-US.md +++ b/docs/react/use-with-next.en-US.md @@ -57,6 +57,10 @@ If you are using the App Router in Next.js and using antd as your component libr 1. Install `@ant-design/cssinjs` +> Notes for developers +> +> Please note that when you install `@ant-design/cssinjs`, you must ensure that the version is consistent with the version of `@ant-design/cssinjs` in local `node_modules` of `antd`, otherwise, multiple React instances will appear, resulting in ctx being unable to be read correctly. (Tips: you can use `npm ls @ant-design/cssinjs` command to view the local version) + 2. Create `lib/AntdRegistry.tsx` @@ -159,6 +163,10 @@ If you are using the Pages Router in Next.js and using antd as your component li 1. Install `@ant-design/cssinjs` +> Notes for developers +> +> Please note that when you install `@ant-design/cssinjs`, you must ensure that the version is consistent with the version of `@ant-design/cssinjs` in local `node_modules` of `antd`, otherwise, multiple React instances will appear, resulting in ctx being unable to be read correctly. (Tips: you can use `npm ls @ant-design/cssinjs` command to view the local version) + 2. Rewrite `pages/_document.tsx` diff --git a/docs/react/use-with-next.zh-CN.md b/docs/react/use-with-next.zh-CN.md index eee7b2921188..23ae50f8e3c1 100644 --- a/docs/react/use-with-next.zh-CN.md +++ b/docs/react/use-with-next.zh-CN.md @@ -57,6 +57,10 @@ export default Home; 1. 安装 `@ant-design/cssinjs` +> 开发者注意事项: +> +> 请注意,安装 `@ant-design/cssinjs` 时必须确保版本号跟 `antd` 本地的 `node_modules` 中的 `@ant-design/cssinjs` 版本保持一致,否则会出现多个 React 实例,导致无法正确的读取 ctx。(Tips: 你可以通过 `npm ls @ant-design/cssinjs` 命令查看本地版本) + 2. 创建 `lib/AntdRegistry.tsx` @@ -159,6 +163,10 @@ export default HomePage; 1. 安装 `@ant-design/cssinjs` +> 开发者注意事项: +> +> 请注意,安装 `@ant-design/cssinjs` 时必须确保版本号跟 `antd` 本地的 `node_modules` 中的 `@ant-design/cssinjs` 版本保持一致,否则会出现多个 React 实例,导致无法正确的读取 ctx。(Tips: 你可以通过 `npm ls @ant-design/cssinjs` 命令查看本地版本) + 2. 改写 `pages/_document.tsx`