mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-02-23 14:48:35 +00:00
Fix: TS2322 - Type of onClose prop.
This commit is contained in:
parent
618d081a2f
commit
63758a27ed
@ -8,11 +8,12 @@ import IconButton from '@mui/material/IconButton';
|
||||
import Snackbar from '@mui/material/Snackbar';
|
||||
import Alert from '@mui/material/Alert';
|
||||
import { ObjectWithStringKeysAndValues } from '../interfaces';
|
||||
import { SnackbarCloseReason } from '@mui/material';
|
||||
|
||||
type OwnProps = {
|
||||
title: string;
|
||||
children?: React.ReactNode;
|
||||
onClose?: Function;
|
||||
onClose?: (event: Event | React.SyntheticEvent<any, Event>, reason: SnackbarCloseReason) => void;
|
||||
type?: 'success' | 'error' | 'warning';
|
||||
hideCloseButton?: boolean;
|
||||
allowTogglingFullMessage?: boolean;
|
||||
@ -45,7 +46,9 @@ export function Notification({
|
||||
|
||||
if (timeout && onClose) {
|
||||
setTimeout(() => {
|
||||
onClose();
|
||||
if (onClose) {
|
||||
onClose(new Event('timeout'), 'timeout');
|
||||
}
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user