Access Modal State #1864
pkl-kirito
started this conversation in
General
Replies: 1 comment 2 replies
-
Here the value of checkbox defines if the modal is open or not so in React you can bind a value to checkbox and then open/close the checkbox as you need. const [isChecked, setIsChecked] = useState(false) <input type="checkbox" id="history-modal" className="modal-toggle" checked={isChecked} /> Let me know if you have any questions |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, how to access the state of the modal is open or close ? Because I have a separate modal, and useEffect only trigger once on page load, but I want to trigger the
useEffect
every time modal is open.Beta Was this translation helpful? Give feedback.
All reactions