J
J
J. Snow2020-01-13 09:27:33
Web development
J. Snow, 2020-01-13 09:27:33

How to make the modal close on clicking the "Back" button in the browser?

I'm making a website with React.
The site has a modal that opens when you click on the button.
Question:
How to make it so that when you click the "Back" button in the browser (including on mobile phones), the modal is closed, and the transition back through the history does not occur?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question