admin管理员组文章数量:1417425
I'm trying to launch MUI modal in my Laravel Inertia React project, but the modal doesn`t show up and doesn't give any error, please help
const [open, setOpen] = useState(false);
const handleOpen = () => setOpen(true);
const handleClose = () => setOpen(false);
<div>
<Button onClick={handleOpen}>Open modal</Button>
<Modal
keepMounted
open={open}
onClose={handleClose}
aria-labelledby="keep-mounted-modal-title"
aria-describedby="keep-mounted-modal-description"
>
<Box sx={style}>
<Typography
id="keep-mounted-modal-title"
variant="h6"
component="h2"
>
Text in a modal
</Typography>
<Typography
id="keep-mounted-modal-description"
sx={{ mt: 2 }}
>
Duis mollis, est non commodo luctus, nisi erat
porttitor ligula.
</Typography>
</Box>
</Modal>
</div>
I tried to make a Tailwindcss modal and it doesn't show either
本文标签: reactjsModal doesn39t show upStack Overflow
版权声明:本文标题:reactjs - Modal doesn't show up - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745266295a2650622.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论