notistack v1.0.0 Release Notes

  • August 22, 2020
    • โฌ‡๏ธ Drop SnackbarContent component and ContentProps props #297 #### ๐Ÿ’ฅ Breaking Changes
    • 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',
          },
        },
      },
    });