The example shows how to use notistack in a React class component. How would notistack be used in a React functional component?
Hi, https://iamhosseindhv.com/notistack How to use, Step 2:
import { useSnackbar } from 'notistack';
const MyButton = () => {
const { enqueueSnackbar, closeSnackbar } = useSnackbar();
const handleClick = () => {
enqueueSnackbar('I love hooks');
};
return (
<Button onClick={handleClick}>Show snackbar</Button>
);
}
Most helpful comment
Hi, https://iamhosseindhv.com/notistack How to use, Step 2: