import React from 'react'; import Button from '@material-ui/core/Button'; import Snackbar from '@material-ui/core/Snackbar'; import MuiAlert, { AlertProps } from '@material-ui/lab/Alert'; import { makeStyles, Theme } from '@material-ui/core/styles'; function Alert(props: AlertProps) { return ; } const useStyles = makeStyles((theme: Theme) => ({ root: { width: '100%', '& > * + *': { marginTop: theme.spacing(2), }, }, })); export default function CustomizedSnackbars() { const classes = useStyles(); const [open, setOpen] = React.useState(false); const handleClick = () => { setOpen(true); }; const handleClose = (event?: React.SyntheticEvent, reason?: string) => { if (reason === 'clickaway') { return; } setOpen(false); }; return (
This is a success message! This is an error message! This is a warning message! This is an information message! This is a success message!
); }