i try to use notistack like following. but it given 'Uncaught TypeError: Cannot read property 'handleEnqueueSnackbar' of undefined'
import { SnackbarProvider, useSnackbar } from 'notistack';
const ConfigureRateList = ()=> {
const { enqueueSnackbar } = useSnackbar();
// codes...
return (
<SnackbarProvider maxSnack={3}>
// codes....
</SnackbarProvider >
)
}
@sajja94 useSnackbar or withSnackbar should be at least one level down the tree. meaning that they're not accessible in the component where you wrap your app in a SnackbarProvider. and are accessible in the children of that component.
Most helpful comment
@sajja94
useSnackbarorwithSnackbarshould be at least one level down the tree. meaning that they're not accessible in the component where you wrap your app in aSnackbarProvider. and are accessible in the children of that component.