Answer the question
In order to leave comments, you need to log in
How to manage multiple modal windows?
Usually, I manage the modal window like this:
const [open, setOpen] = useState(false)
return(
{open ? <Modal></Modal> : null}
)
Answer the question
In order to leave comments, you need to log in
const [window, setWindow] = useState()
switch (window) {
case 'window1':
return <Modal1></Modal1>
case 'window2':
return <Modal2></Modal2>
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question