Prova così
Oppure così tenendo fisso open sul dialog ed includendolo solo comandando dal componente principale (non so come funziona quel dialog specifico se ha delle property native specifiche)codice:export default function Home() { ....................... const [open, showDialog] useState(false); return ( <MaterialTable .............. actions={[ { icon: 'add', tooltip: 'Aggiungi libro', isFreeAction: true, onClick: (event) => showDialog(true) } ]} ........................ /> <DialogBook open={open}/> ); }
codice:export default function Home() { ....................... const [open, showDialog] useState(false); return ( <MaterialTable .............. actions={[ { icon: 'add', tooltip: 'Aggiungi libro', isFreeAction: true, onClick: (event) => showDialog(true) } ]} ........................ /> {open && <DialogBook open={true}/>} ); }

Rispondi quotando