fkhadra / react-toastify

React notification made easy 🚀 !
https://fkhadra.github.io/react-toastify/introduction
MIT License
12.72k stars 700 forks source link

Dismiss is not working with 0 #316

Closed Hoijof closed 5 years ago

Hoijof commented 5 years ago

Do you want to request a feature or report a bug? BUG

What is the current behavior? If you try to dismiss a toast with id 0 it treats it as a falsy value and dismisses all the toasts ;D

because of this: https://github.com/fkhadra/react-toastify/blob/48deb57ae26f3829eea47d0c6084874f385030a9/src/components/ToastContainer.js#L159 What is the expected behavior?

Should treat 0 like a proper number :(

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Irrelevant.

fkhadra commented 5 years ago

Hello @Hoijof,

Thank you for reporting the issue. Wanna submit a PR ?

alanlima commented 5 years ago

Hi @fkhadra and @Hoijof

I am looking to contribute, and I can fix it if you don't mind. 🤗