fix: fix message.destroy parameter (#26864)

* fix: fix message.destroy parameter

* chore: use React.Key
This commit is contained in:
lihqi 2020-09-25 11:01:41 +08:00 committed by GitHub
parent 006abe5e92
commit cc37f7d189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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