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]; }