diff --git a/docs/data/material/components/snackbars/AutohideSnackbar.tsx b/docs/data/material/components/snackbars/AutohideSnackbar.tsx index 1f1393e26e246a..b5fd1f75e775b0 100644 --- a/docs/data/material/components/snackbars/AutohideSnackbar.tsx +++ b/docs/data/material/components/snackbars/AutohideSnackbar.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import Button from '@mui/material/Button'; -import Snackbar from '@mui/material/Snackbar'; +import Snackbar, { SnackbarCloseReason } from '@mui/material/Snackbar'; export default function AutohideSnackbar() { const [open, setOpen] = React.useState(false); @@ -9,7 +9,10 @@ export default function AutohideSnackbar() { setOpen(true); }; - const handleClose = (event: React.SyntheticEvent | Event, reason?: string) => { + const handleClose = ( + event: React.SyntheticEvent | Event, + reason?: SnackbarCloseReason, + ) => { if (reason === 'clickaway') { return; } diff --git a/docs/data/material/components/snackbars/ConsecutiveSnackbars.tsx b/docs/data/material/components/snackbars/ConsecutiveSnackbars.tsx index 803b3f2f98d6e3..633379ab04a5c4 100644 --- a/docs/data/material/components/snackbars/ConsecutiveSnackbars.tsx +++ b/docs/data/material/components/snackbars/ConsecutiveSnackbars.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import Button from '@mui/material/Button'; -import Snackbar from '@mui/material/Snackbar'; +import Snackbar, { SnackbarCloseReason } from '@mui/material/Snackbar'; import IconButton from '@mui/material/IconButton'; import CloseIcon from '@mui/icons-material/Close'; @@ -32,7 +32,10 @@ export default function ConsecutiveSnackbars() { setSnackPack((prev) => [...prev, { message, key: new Date().getTime() }]); }; - const handleClose = (event: React.SyntheticEvent | Event, reason?: string) => { + const handleClose = ( + event: React.SyntheticEvent | Event, + reason?: SnackbarCloseReason, + ) => { if (reason === 'clickaway') { return; } diff --git a/docs/data/material/components/snackbars/CustomizedSnackbars.tsx b/docs/data/material/components/snackbars/CustomizedSnackbars.tsx index 845499080d06a0..912af5eae4927d 100644 --- a/docs/data/material/components/snackbars/CustomizedSnackbars.tsx +++ b/docs/data/material/components/snackbars/CustomizedSnackbars.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import Button from '@mui/material/Button'; -import Snackbar from '@mui/material/Snackbar'; +import Snackbar, { SnackbarCloseReason } from '@mui/material/Snackbar'; import Alert from '@mui/material/Alert'; export default function CustomizedSnackbars() { @@ -10,7 +10,10 @@ export default function CustomizedSnackbars() { setOpen(true); }; - const handleClose = (event?: React.SyntheticEvent | Event, reason?: string) => { + const handleClose = ( + event?: React.SyntheticEvent | Event, + reason?: SnackbarCloseReason, + ) => { if (reason === 'clickaway') { return; } diff --git a/docs/data/material/components/snackbars/SimpleSnackbar.tsx b/docs/data/material/components/snackbars/SimpleSnackbar.tsx index 410819edb86eec..bf0aed8afdd95b 100644 --- a/docs/data/material/components/snackbars/SimpleSnackbar.tsx +++ b/docs/data/material/components/snackbars/SimpleSnackbar.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import Button from '@mui/material/Button'; -import Snackbar from '@mui/material/Snackbar'; +import Snackbar, { SnackbarCloseReason } from '@mui/material/Snackbar'; import IconButton from '@mui/material/IconButton'; import CloseIcon from '@mui/icons-material/Close'; @@ -11,7 +11,10 @@ export default function SimpleSnackbar() { setOpen(true); }; - const handleClose = (event: React.SyntheticEvent | Event, reason?: string) => { + const handleClose = ( + event: React.SyntheticEvent | Event, + reason?: SnackbarCloseReason, + ) => { if (reason === 'clickaway') { return; }