0.1.5 • Published 2 years ago
modale-custom-react v0.1.5
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
}
</>
)