From cc37f7d189abc3f3a94651883213a056eaf16716 Mon Sep 17 00:00:00 2001 From: lihqi <455711093@qq.com> Date: Fri, 25 Sep 2020 11:01:41 +0800 Subject: [PATCH] fix: fix message.destroy parameter (#26864) * fix: fix message.destroy parameter * chore: use React.Key --- components/message/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/message/index.tsx b/components/message/index.tsx index 5367ab5df1..315a2aacff 100755 --- a/components/message/index.tsx +++ b/components/message/index.tsx @@ -193,7 +193,7 @@ function isArgsProps(content: JointContent): content is ArgsProps { const api: any = { open: notice, config: setMessageConfig, - destroy(messageKey?: number | string) { + destroy(messageKey?: React.Key) { if (messageInstance) { if (messageKey) { const { removeNotice } = messageInstance; @@ -243,7 +243,7 @@ export interface MessageInstance { export interface MessageApi extends MessageInstance { warn(content: JointContent, duration?: ConfigDuration, onClose?: ConfigOnClose): MessageType; config(options: ConfigOptions): void; - destroy(): void; + destroy(messageKey?: React.Key): void; useMessage(): [MessageInstance, React.ReactElement]; }