Skip to content

An opinionated toast component for React.

Allow dismissing toasts with id = 0 (#442)

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