You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
onClose callback only return (key) at the moment, but it will be very useful if the original (event, reason) are also returned.
The benefits being that passing the (event, reason) in the custom onClose callback is like below
knows the exact reason about the closing.
The material-ui only has two reasons at the moment, but it could have more reasons in the future
With event parameter, we can identify where the notification is from, therefore knows which case is this closing about. Say I have a single global (centra) notification component (say named NOTIFIER) with notistack, any component (say 30 components) in the application may fire a notification through NOTIFIER with their own action. And I may have another global component to post-process when user clicks the notification action. With the event parameter, we can identify the case (or another word which origin component) where this notification was fired.
onClose callback only return (key) at the moment, but it will be very useful if the original (event, reason) are also returned.
The benefits being that passing the (event, reason) in the custom onClose callback is like below
some discussion has gone through this in Allow "onClose" and "onExited" callbacks. The changes to the code as mentioned by @iamhosseindhv looks good
(and event will get passed to onExited callback as well)
The text was updated successfully, but these errors were encountered: