Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onExited's arguments are different from docs #279

Closed
r-tae opened this issue May 22, 2020 · 2 comments
Closed

onExited's arguments are different from docs #279

r-tae opened this issue May 22, 2020 · 2 comments

Comments

@r-tae
Copy link

r-tae commented May 22, 2020

Expected Behavior

The only documentation that shows the usage of onExited uses it with two arguments as such:

onExited: (event, myKey) => {
    // removen this snackbar from redux store
    dispatch(removeSnackbar(myKey));
    removeDisplayed(myKey);
}

This works in the CodeSandbox it's given in, but in the latest version the API is different

Current Behavior

the arguments appear to actually be (an element (?!), reason, key) though reason is undefined under normal circumstances. This is also the cause of #276.

Steps to Reproduce

Link: As Gareon noted in #276, this behaviour can be found in the redux example if you add a console.log statement
https://codesandbox.io/s/priceless-vaughan-rusvb?fontsize=14&hidenavigation=1&module=%2FNotifier.js&theme=dark

Context

Old messages in my store weren't being deleted and it was causing logic errors in my application

Your Environment

The environment doesn't affect this behaviour

Tech Version
Notistack v0.9.16
@iamhosseindhv
Copy link
Owner

This is bug caused by latest version of material-ui. meaning if you downgrade MUI core it'll start working:
mui/material-ui#21091

Alternatively and temporarily, you can access the key as the third argument.

@iamhosseindhv
Copy link
Owner

Dup of #276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants