From e0ded8431e37fba99a4bc1dbc13b45565a7873f9 Mon Sep 17 00:00:00 2001 From: rizqitsani Date: Thu, 16 May 2024 16:09:37 +0700 Subject: [PATCH] Fix unsuccessful test --- src/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index f13f957..a5d7a2d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -546,6 +546,8 @@ const Toaster = (props: ToasterProps) => { if (!toasts.find((toast) => toast.id === toastToRemove.id)?.delete) { ToastState.dismiss(toastToRemove.id); } + + setToasts((toasts) => toasts.filter(({ id }) => id !== toastToRemove.id)) }, [toasts], );