fix: toast hook close func

This commit is contained in:
shuai 2022-09-28 16:59:53 +08:00
parent 0868952992
commit ee729d8247
1 changed files with 5 additions and 2 deletions

View File

@ -28,8 +28,11 @@ const useToast = () => {
});
const onClose = () => {
//
root.unmount();
const parent = document.querySelector('.page-wrap');
if (parent?.contains(div)) {
parent.removeChild(div);
}
setShow(false);
};