diff --git a/components/date-picker/index.en-US.md b/components/date-picker/index.en-US.md index 2801d8cb71..43d008ec61 100644 --- a/components/date-picker/index.en-US.md +++ b/components/date-picker/index.en-US.md @@ -56,6 +56,12 @@ The default locale is en-US, if you need to use other languages, recommend to us If there are special needs (only modifying single component language), Please use the property: local. Example: [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json). + +:::warning +When use with Nextjs App Router, make sure to add `'use client'` before import locale file of dayjs. +It's because all components of Ant Design only works in client, importing locale in RSC will not work. +::: + ```jsx import locale from 'antd/es/date-picker/locale/zh_CN'; diff --git a/components/date-picker/index.zh-CN.md b/components/date-picker/index.zh-CN.md index 7ed5483b3d..c1fe46aa01 100644 --- a/components/date-picker/index.zh-CN.md +++ b/components/date-picker/index.zh-CN.md @@ -57,6 +57,12 @@ demo: 如有特殊需求(仅修改单一组件的语言),请使用 locale 参数,参考:[默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json)。 + +:::warning +在搭配 Nextjs 的 App Router 使用时,注意在引入 dayjs 的 locale 文件时加上 `'use client'`。 +这是由于 Ant Design 的组件都是客户端组件,在 RSC 中引入 dayjs 的 locale 文件将不会在客户端生效。 +::: + ```jsx import locale from 'antd/es/date-picker/locale/zh_CN';