How can I close a modal popup on hitting escape?
This modal can be closed with the escape key on your keyboard. Note: You need to press the tab key on the keyboard to first enter the modal window, and then press the Esc key.
How do you close a modal in react?
To close the modal, simply call the handleClose() function inside the onLoginFormSubmit() function body.