type: strong type (#37258)

This commit is contained in:
lijianan 2022-08-28 22:29:14 +08:00 committed by GitHub
parent 0483d7a79b
commit 58a1268356
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ export default function createUseMessage(
) => void,
getRCNoticeProps: (args: ArgsProps, prefixCls: string) => RCNoticeContent,
) {
const useMessage = (): [MessageInstance, React.ReactElement] => {
const useMessage = (): readonly [MessageInstance, React.ReactElement] => {
// We can only get content by render
let getPrefixCls: ConfigConsumerProps['getPrefixCls'];
let getPopupContainer: ConfigConsumerProps['getPopupContainer'];
@ -83,7 +83,7 @@ export default function createUseMessage(
return holder;
}}
</ConfigConsumer>,
];
] as const;
};
return useMessage;

View File

@ -16,7 +16,7 @@ export default function createUseNotification(
) => void,
getRCNoticeProps: (args: ArgsProps, prefixCls: string) => RCNoticeContent,
) {
const useNotification = (): [NotificationInstance, React.ReactElement] => {
const useNotification = (): readonly [NotificationInstance, React.ReactElement] => {
// We can only get content by render
let getPrefixCls: ConfigConsumerProps['getPrefixCls'];
@ -67,7 +67,7 @@ export default function createUseNotification(
return holder;
}}
</ConfigConsumer>,
];
] as const;
};
return useNotification;