gor181 / react-notification-system-redux

Redux wrapper for react-notification-system
MIT License
324 stars 59 forks source link

Callback `onRemove` not being called #16

Closed LKay closed 7 years ago

LKay commented 8 years ago

According to #10 onRemove should be called and when I check the code pulled from npm it is as described. Unfortunately the callback is never fired in case the notification is auto or manually dismissed.

Code to reproduce:

const id = "someID"

function onDismiss () {
        store.dispatch(hide(id))
    }

const notification = {
        children    : (<Notification id={ uid } onDismiss={ onDismiss } level={ "info" } message={ message } title={ title }  />), /* custom body component */
        dismissible : false,
        level       : "info",
        uid,
        autoDismiss : 5,
        onRemove    : () => console.log("callback") /* this is never fired */
    }

store.dispatch(show(notification))

This only happens when notifications container is rendered with style={ false } property.

gor181 commented 7 years ago

Hey @LKay ,

I have wrote some tests to check this, and it seems to work just fine. Please check #22 and let me know what you think.

Maybe I'm reproducing it incorrectly.

Cheers,

gor181 commented 7 years ago

I'm closing this one until reproduced. cheers @LKay