Open demigor opened 9 months ago
If you listen for the onChange event on toast it returns a ToastItem payload. Inside of it you can check the toast status property . When you click inside the toast, close the toast with x and on toast autoClose they ALL return status : removed
in my case there is no way for me to reproduce the onClick event which was working only when you click inside the toast and not on the x button.
In your case its the onClose that has the same status.
here is the link to try it out yourself : https://fkhadra.github.io/react-toastify/listen-for-changes
I'm struggling to remove toasts from Notification Center, that were manually closed (with close button click).
However, in onClose there is no way to distinguish wether the toast was closed automatically (via timeout) or by user action (close button click).
Tried with custom button, but the button does not receive any toast related properties, so there is no way to dismiss related toast from notification center in button's onClick event.
Any help would be appreciated. Thank you