I'm trying to work material-ui snackbar component on my nextjs project, but it not working. And next, I try to this code on reactjs it's working so nicely. that's my code is working on reactjs but does not working on nextjs. Please help me, guys.
My full Code:
import Button from '@mui/material/Button';
import Snackbar from '@mui/material/Snackbar';
import { useState } from 'react';
export default function Demo() {
const [open, setOpen] = useState(false);
const toggleOpen = () => setOpen((prev) => !prev);
return (
<div>
<Button variant="contained" onClick={toggleOpen}>
Open Snackbar: {open ? 'opened' : 'hidden'}
</Button>
<Snackbar message="This is archived" opne={open} />
</div>
);
}