Created
November 4, 2021 12:43
-
-
Save Reine0017/b0e895dc1d0476920b21143d44e15a42 to your computer and use it in GitHub Desktop.
Demo with Portal - ReactPortalPage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ReactPortalPage() { | |
| const [openModal1, setOpenModal1] = useState(false) | |
| return ( | |
| <div className="ReactPortalPage"> | |
| THIS IS THE REACT PORTAL PAGE (TO DEMO REACT PORTALS W MODALS) | |
| {/* ...commented out for brevity */} | |
| <div className="withPortal"> | |
| Demo With Portal | |
| <div className="sectionContent" onClick={() => console.log("clicked withPortal")}> | |
| <button onClick={() => setOpenModal1(true)}>Click Me To Open Modal</button> | |
| <ModalPortal openModal={openModal1} closeModal={() => setOpenModal1(false)}/> | |
| </div> | |
| </div> | |
| </div> | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment