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