First, thank you very much to all contributors!
Do you want to request a feature or report a bug?
report a bug
What is the current behavior?
eventManager.off(ACTION.SHOW).off(ACTION.CLEAR).emit(ACTION.WILL_UNMOUNT, this); which will be triggered on componentWillUnmount of a ToastContainer removes event-handlers of all ToastContainer and not only the event-handlers for the ToastContainer which will be unmounted. Unfortunately this (one global and multiple ToastContainers) is exactly my use case.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your CodeSandbox (https://codesandbox.io/s/new) example below:
Demo: https://codesandbox.io/embed/react-toastify-with-multiple-toastcontainer-21t16
hi, i have encountered this bug too, my case is creating ToastContainers with array.map. when the array size reduced, some ToastContainers are unmounted and the rest of them are still mounted but the toasts were not shown. Thanks for the multi toastcontainers feature though, it helps me a lot on my working project.:smile:
I'm having the exact same problem. We mount a ToastContainer in a Bootstrap Modal (via Reactstrap), and as soon as the modal is closed, no toasts are displayed anymore.
Would love to get feedback on this issue!
Hello,
Thank you for reporting the issue. I'm working on a fix.
Hey the v5.4.1 fix the issue.
Thank you very much! Unfortunately I had no time to test. I hope I can test it tomorrow.
Works. Again, thank you very much!
@m4r71n thank you for the feedback appreciate !
Most helpful comment
Hey the v5.4.1 fix the issue.