Notistack: Documentation: active snackbar from notistack can resets theme colors

Created on 18 Jul 2019  路  1Comment  路  Source: iamhosseindhv/notistack

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.

Most helpful comment

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nebojsanb picture nebojsanb  路  3Comments

Brettm12345 picture Brettm12345  路  6Comments

iamhosseindhv picture iamhosseindhv  路  8Comments

VincentLanglet picture VincentLanglet  路  3Comments

alexisab picture alexisab  路  5Comments