iamhosseindhv / notistack

Highly customizable notification snackbars (toasts) that can be stacked on top of each other
https://notistack.com
Other
3.93k stars 298 forks source link

Documentation: active snackbar from notistack can resets theme colors #146

Closed keul closed 5 years ago

keul commented 5 years ago

Expected Behavior

Snackbars item opened by notistack should not change the global theme, and it's not doing it, but documentation can lead users to wrong nesting.

Steps to Reproduce

Take the codesanbox link below. I'm more or less reproducing what docs says:

<SnackbarProvider maxSnack={3}>
    <App />
</SnackbarProvider>

...but I've also a custom ThemeProvider

https://codesandbox.io/s/notistack-issue-3673u

Context

The issue is easily fixable: the SnackbarProvider component should be wrapped inside the custom ThemeProvider, but documentation is not helping.

I think that a clear indication about this can save debug time or issue report.

iamhosseindhv commented 5 years ago

Thanks @keul ❤️ The following line has been added to the docs website:

Note: If you're using material-ui ThemeProvider, make sure SnackbarProvider is a child of it.

Hopefully it be useful in future.