chore: update Next.js docs (#45907)

* docs: update Nextjs docs

* Update use-with-next.en-US.md

Signed-off-by: lijianan <574980606@qq.com>

* Update use-with-next.zh-CN.md

Signed-off-by: lijianan <574980606@qq.com>

* update

* Update use-with-next.en-US.md

Signed-off-by: lijianan <574980606@qq.com>

* Update use-with-next.zh-CN.md

Signed-off-by: lijianan <574980606@qq.com>

---------

Signed-off-by: lijianan <574980606@qq.com>
This commit is contained in:
lijianan 2023-11-16 20:14:27 +08:00 committed by GitHub
parent 2dda417e29
commit efbaf8d186
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -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)
<InstallDependencies npm='$ npm install @ant-design/cssinjs --save' yarn='$ yarn add @ant-design/cssinjs' pnpm='$ pnpm install @ant-design/cssinjs --save'></InstallDependencies>
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)
<InstallDependencies npm='$ npm install @ant-design/cssinjs --save' yarn='$ yarn add @ant-design/cssinjs' pnpm='$ pnpm install @ant-design/cssinjs --save'></InstallDependencies>
2. Rewrite `pages/_document.tsx`

View File

@ -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` 命令查看本地版本)
<InstallDependencies npm='$ npm install @ant-design/cssinjs --save' yarn='$ yarn add @ant-design/cssinjs' pnpm='$ pnpm install @ant-design/cssinjs --save'></InstallDependencies>
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` 命令查看本地版本)
<InstallDependencies npm='$ npm install @ant-design/cssinjs --save' yarn='$ yarn add @ant-design/cssinjs' pnpm='$ pnpm install @ant-design/cssinjs --save'></InstallDependencies>
2. 改写 `pages/_document.tsx`