Skip to content

AdrienW86/Modal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

component npm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published