Content of the modal
To display the modal, just create a state:
const [toggle, setToggle] = useState(false)
And a closeModal function:
const closeModal = () => {
setToggle(false)
}
Then the modal is displayed or not depending on the value of toggle:
return(
<>
{toggle
?
<Modal
close = {closeModal}
text = "Your text"
/>
:
null
}
</>
)