From 57f9f4e81d615151a6140d7e76f08ea5433dee1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91=E9=9B=A8?= Date: Fri, 23 Dec 2022 12:53:30 +0800 Subject: [PATCH 1/4] feat: update doc --- components/message/index.zh-CN.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/components/message/index.zh-CN.md b/components/message/index.zh-CN.md index c0ddcb1f8f7d..dea87ad5d797 100644 --- a/components/message/index.zh-CN.md +++ b/components/message/index.zh-CN.md @@ -132,6 +132,24 @@ return ( **异同**:通过 hooks 创建的 `contextHolder` 必须插入到子元素节点中才会生效,当你不需要上下文信息时请直接调用。 +### 也可以通过 [App 包裹组件](https://ant.design/components/app-cn)包裹达到简化代码的目的 + +```tsx +// sub page +const MyPage: React.FC = () => { + const { message, notification, modal } = App.useApp(); + message.success('Good!'); + // .... +}; + +// Entry component +const MyApp: React.FC = () => ( + + + +); +``` + ### 静态方法如何设置 prefixCls ? 你可以通过 [`ConfigProvider.config`](/components/config-provider-cn#configproviderconfig-4130) 进行设置。 From dbfc346a7a4fd80ef7ca307e118145033037e8d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91=E9=9B=A8?= Date: Fri, 23 Dec 2022 14:18:24 +0800 Subject: [PATCH 2/4] feat: update doc --- components/message/index.en-US.md | 2 ++ components/message/index.zh-CN.md | 18 +----------------- components/modal/index.en-US.md | 2 ++ components/modal/index.zh-CN.md | 2 ++ components/notification/index.en-US.md | 2 ++ components/notification/index.zh-CN.md | 2 ++ 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/components/message/index.en-US.md b/components/message/index.en-US.md index 4dccbdf5c0aa..6846aa2618c0 100644 --- a/components/message/index.en-US.md +++ b/components/message/index.en-US.md @@ -131,6 +131,8 @@ return ( **Note:** You must insert `contextHolder` into your children with hooks. You can use origin method if you do not need context connection. +### [App Package Component](https://ant.design/components/app-cn) can be used to simplify the problem of useMessage and other methods that need to manually implant contextHolder + ### How to set static methods prefixCls ? You can config with [`ConfigProvider.config`](/components/config-provider#configproviderconfig-4130) diff --git a/components/message/index.zh-CN.md b/components/message/index.zh-CN.md index dea87ad5d797..b14e6af3ec6a 100644 --- a/components/message/index.zh-CN.md +++ b/components/message/index.zh-CN.md @@ -132,23 +132,7 @@ return ( **异同**:通过 hooks 创建的 `contextHolder` 必须插入到子元素节点中才会生效,当你不需要上下文信息时请直接调用。 -### 也可以通过 [App 包裹组件](https://ant.design/components/app-cn)包裹达到简化代码的目的 - -```tsx -// sub page -const MyPage: React.FC = () => { - const { message, notification, modal } = App.useApp(); - message.success('Good!'); - // .... -}; - -// Entry component -const MyApp: React.FC = () => ( - - - -); -``` +### 可通过 [App 包裹组件](https://ant.design/components/app-cn) 简化 useMessage 等方法需要手动植入 contextHolder 的问题 ### 静态方法如何设置 prefixCls ? diff --git a/components/modal/index.en-US.md b/components/modal/index.en-US.md index 1a5dbfbe6c1d..d2baa58e2282 100644 --- a/components/modal/index.en-US.md +++ b/components/modal/index.en-US.md @@ -194,6 +194,8 @@ return ( **Note:** You must insert `contextHolder` into your children with hooks. You can use origin method if you do not need context connection. +### [App Package Component](https://ant.design/components/app-cn) can be used to simplify the problem of useModal and other methods that need to manually implant contextHolder + ### How to disable motion? You can config `transitionName=""` and `maskTransitionName=""` to remove motion class. But you should note that these prop is internal usage which we don't promise exist in next major version. diff --git a/components/modal/index.zh-CN.md b/components/modal/index.zh-CN.md index f469a6f62ff5..39334fb6a713 100644 --- a/components/modal/index.zh-CN.md +++ b/components/modal/index.zh-CN.md @@ -195,6 +195,8 @@ return ( **异同**:通过 hooks 创建的 `contextHolder` 必须插入到子元素节点中才会生效,当你不需要上下文信息时请直接调用。 +### 可通过 [App 包裹组件](https://ant.design/components/app-cn) 简化 useModal 等方法需要手动植入 contextHolder 的问题 + ### 如何关闭 Modal 动画? 你可以通过 `transitionName=""` 和 `maskTransitionName=""` 去除动画 CSS,但是需要注意的是。该方法为内部方法,我们不保证下个大版本重构时该属性会被保留。 diff --git a/components/notification/index.en-US.md b/components/notification/index.en-US.md index 244f66adedca..2d804bfd1a3e 100644 --- a/components/notification/index.en-US.md +++ b/components/notification/index.en-US.md @@ -115,6 +115,8 @@ return ( **Note:** You must insert `contextHolder` into your children with hooks. You can use origin method if you do not need context connection. +### [App Package Component](https://ant.design/components/app-cn) can be used to simplify the problem of useNotification and other methods that need to manually implant contextHolder + ### How to set static methods prefixCls ? You can config with [`ConfigProvider.config`](/components/config-provider#configproviderconfig-4130) diff --git a/components/notification/index.zh-CN.md b/components/notification/index.zh-CN.md index 204287f2d892..6f3dea2a072d 100644 --- a/components/notification/index.zh-CN.md +++ b/components/notification/index.zh-CN.md @@ -115,6 +115,8 @@ return ( **异同**:通过 hooks 创建的 `contextHolder` 必须插入到子元素节点中才会生效,当你不需要上下文信息时请直接调用。 +### 可通过 [App 包裹组件](https://ant.design/components/app-cn) 简化 useMessage 等方法需要手动植入 contextHolder 的问题 + ### 静态方法如何设置 prefixCls ? 你可以通过 [`ConfigProvider.config`](/components/config-provider-cn#configproviderconfig-4130) 进行设置。 From f24a52aa0e3704d493f59a4863614b29972c716e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91=E9=9B=A8?= Date: Sat, 24 Dec 2022 18:19:42 +0800 Subject: [PATCH 3/4] feat: update doc --- components/message/index.en-US.md | 2 +- components/message/index.zh-CN.md | 2 +- components/modal/index.en-US.md | 2 +- components/modal/index.zh-CN.md | 2 +- components/notification/index.en-US.md | 2 +- components/notification/index.zh-CN.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/message/index.en-US.md b/components/message/index.en-US.md index 6846aa2618c0..60ee591a3864 100644 --- a/components/message/index.en-US.md +++ b/components/message/index.en-US.md @@ -131,7 +131,7 @@ return ( **Note:** You must insert `contextHolder` into your children with hooks. You can use origin method if you do not need context connection. -### [App Package Component](https://ant.design/components/app-cn) can be used to simplify the problem of useMessage and other methods that need to manually implant contextHolder +> [App Package Component](/components/app-cn) can be used to simplify the problem of `useMessage` and other methods that need to manually implant contextHolder. ### How to set static methods prefixCls ? diff --git a/components/message/index.zh-CN.md b/components/message/index.zh-CN.md index b14e6af3ec6a..e048de99fa9c 100644 --- a/components/message/index.zh-CN.md +++ b/components/message/index.zh-CN.md @@ -132,7 +132,7 @@ return ( **异同**:通过 hooks 创建的 `contextHolder` 必须插入到子元素节点中才会生效,当你不需要上下文信息时请直接调用。 -### 可通过 [App 包裹组件](https://ant.design/components/app-cn) 简化 useMessage 等方法需要手动植入 contextHolder 的问题 +> 可通过 [App 包裹组件](/components/app-cn) 简化 useMessage 等方法需要手动植入 contextHolder 的问题。 ### 静态方法如何设置 prefixCls ? diff --git a/components/modal/index.en-US.md b/components/modal/index.en-US.md index d2baa58e2282..720755f8ac29 100644 --- a/components/modal/index.en-US.md +++ b/components/modal/index.en-US.md @@ -194,7 +194,7 @@ return ( **Note:** You must insert `contextHolder` into your children with hooks. You can use origin method if you do not need context connection. -### [App Package Component](https://ant.design/components/app-cn) can be used to simplify the problem of useModal and other methods that need to manually implant contextHolder +> [App Package Component](/components/app-cn) can be used to simplify the problem of `useModal` and other methods that need to manually implant contextHolder. ### How to disable motion? diff --git a/components/modal/index.zh-CN.md b/components/modal/index.zh-CN.md index 39334fb6a713..eaebbdf1a3c4 100644 --- a/components/modal/index.zh-CN.md +++ b/components/modal/index.zh-CN.md @@ -195,7 +195,7 @@ return ( **异同**:通过 hooks 创建的 `contextHolder` 必须插入到子元素节点中才会生效,当你不需要上下文信息时请直接调用。 -### 可通过 [App 包裹组件](https://ant.design/components/app-cn) 简化 useModal 等方法需要手动植入 contextHolder 的问题 +> 可通过 [App 包裹组件](/components/app-cn) 简化 `useModal` 等方法需要手动植入 contextHolder 的问题。 ### 如何关闭 Modal 动画? diff --git a/components/notification/index.en-US.md b/components/notification/index.en-US.md index 2d804bfd1a3e..bfe4a5aa8e1f 100644 --- a/components/notification/index.en-US.md +++ b/components/notification/index.en-US.md @@ -115,7 +115,7 @@ return ( **Note:** You must insert `contextHolder` into your children with hooks. You can use origin method if you do not need context connection. -### [App Package Component](https://ant.design/components/app-cn) can be used to simplify the problem of useNotification and other methods that need to manually implant contextHolder +> [App Package Component](/components/app-cn) can be used to simplify the problem of `useNotification` and other methods that need to manually implant contextHolder. ### How to set static methods prefixCls ? diff --git a/components/notification/index.zh-CN.md b/components/notification/index.zh-CN.md index 6f3dea2a072d..575190b9a6f7 100644 --- a/components/notification/index.zh-CN.md +++ b/components/notification/index.zh-CN.md @@ -115,7 +115,7 @@ return ( **异同**:通过 hooks 创建的 `contextHolder` 必须插入到子元素节点中才会生效,当你不需要上下文信息时请直接调用。 -### 可通过 [App 包裹组件](https://ant.design/components/app-cn) 简化 useMessage 等方法需要手动植入 contextHolder 的问题 +> 可通过 [App 包裹组件](/components/app-cn) 简化 `useNotification` 等方法需要手动植入 contextHolder 的问题。 ### 静态方法如何设置 prefixCls ? From 3c6d37746796653987e1799f4f9669f348ec56ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91=E9=9B=A8?= Date: Mon, 26 Dec 2022 08:52:41 +0800 Subject: [PATCH 4/4] feat: update doc --- components/message/index.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/message/index.zh-CN.md b/components/message/index.zh-CN.md index e048de99fa9c..90b13ad46fdf 100644 --- a/components/message/index.zh-CN.md +++ b/components/message/index.zh-CN.md @@ -132,7 +132,7 @@ return ( **异同**:通过 hooks 创建的 `contextHolder` 必须插入到子元素节点中才会生效,当你不需要上下文信息时请直接调用。 -> 可通过 [App 包裹组件](/components/app-cn) 简化 useMessage 等方法需要手动植入 contextHolder 的问题。 +> 可通过 [App 包裹组件](/components/app-cn) 简化 `useMessage` 等方法需要手动植入 contextHolder 的问题。 ### 静态方法如何设置 prefixCls ?