modale-custom-react

0.1.5 • Public • Published

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
    }
    </>
)

Github: https://github.com/AdrienW86/Modal.git

Readme

Keywords

Package Sidebar

Install

npm i modale-custom-react

Weekly Downloads

0

Version

0.1.5

License

ISC

Unpacked Size

3.37 kB

Total Files

5

Last publish

Collaborators

  • _ades_