Skip to content

An opinionated toast component for React.

fix toast timer (#458)

Emil Kowalskib974a5b8af07
diff --git a/src/state.ts b/src/state.ts
index ae385e6..67260e7 100644
--- a/src/state.ts
+++ b/src/state.ts
@@ -70,7 +70,7 @@ class Observer {
};
dismiss = (id?: number | string) => {
- if (typeof id !== undefined && id !== '') {
+ if (!id) {
this.toasts.forEach((toast) => {
this.subscribers.forEach((subscriber) => subscriber({ id: toast.id, dismiss: true }));
});