Back to All

How to set back button to close modals/overlays?

Hi! I would like to see this functionality in my app, mirroring similar features I see in native apps. For example on an app such as Uber Eats, if I have some sort of modal or overlay active, and then I press the native back button on my phone, it toggles it closed. The behaviour I see with GoNative mirrors the browser, where instead of closing the modal, it will direct you to the previous page instead. Is there some kind of way to make it so when a modal is open, the default behaviour of the back button is changed?