fix: notice ui blocking

This commit is contained in:
GyDi 2022-05-13 02:29:43 +08:00
parent 31c6cbc0a2
commit d695656b8c
No known key found for this signature in database
GPG Key ID: 1C95E0D3467B3084

View File

@ -86,7 +86,9 @@ const Notice: NoticeInstance = (props) => {
}; };
(["info", "error", "success"] as const).forEach((type) => { (["info", "error", "success"] as const).forEach((type) => {
Notice[type] = (message, duration) => Notice({ type, message, duration }); Notice[type] = (message, duration) => {
setTimeout(() => Notice({ type, message, duration }), 0);
};
}); });
export default Notice; export default Notice;