react-modal: How to close one modal and open a new one at the same time?
问题 I want to implement an authentication modal like Airbnb/Medium. When I click "Sign Up" in the Login Modal, The Login Modal closes and the Register Modal opens. I read react-modal docs and didn't see a way to do so. Could anyone please assist me finding a solution. Thanks. 回答1: I don't use React Modal, but I know a way of implementing it. The idea is to wrap your Sign Up and Login components inside a parent component that stores the modals' state and open/close methods. These methods can then