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

Drop SnackbarContent and ContentProps #297

Merged
merged 8 commits into from
Aug 22, 2020
Merged

Conversation

iamhosseindhv
Copy link
Owner

  • className prop is now used to customise styles applied to the content of snackbar (e.g. backgroundColor).
  • If you were using className to apply styles to Snackbar component, you should now do so using classes.root.
<SnackbarProvider
-  className={classes.snackbar}
+  classes={{
+    root: classes.snackbar
+  }}
>
  • ContentProps prop is not supported anymore. Here are alternative ways to pass the same data to snackbar component. For any other
    scenario, you should pass you own custom content.
<SnackbarProvider
-  ContentProps={{
-    action: () => <button>dismiss</button>,
-    'aria-describedby': 'some-value',
-  }}
+  action={() => <button>dismiss</button>}
+  ariaAttributes={{
+    'aria-describedby': 'some-value'
+  }}
>
  • If you have customised MuiSnackbarContent through Material-UI theme object, these changes won't automatically
    reflect within notistack. You can however, use className prop to apply your customisations.
const theme = createMuiTheme({
  overrides: {
    // no effect within notistack
    MuiSnackbarContent: {
      root: {
        fontSize: '1rem',
      },
    },
  },
});

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

Successfully merging this pull request may close these issues.

1 participant