When our app receives an unauthorized response from one of our API calls, we automatically redirect the user to the login screen. This action can occur at any time due to background refreshes triggered by web sockets, among other factors. The challenge lies in ensuring that native UI dialog-style components like Alerts, Android date/time pickers, iOS action sheets, and camera pickers are dismissed when such events occur.
While it is possible to create JavaScript alternatives for some native modals, such as using a custom overlay in place of Alerts or action sheets, completely replacing all native modal components is daunting. Issues have been observed with native modal components lingering on the screen even after dismissing a view in React Navigation, particularly with iOS devices. Finding a solution for handling these scenarios seamlessly remains a priority, as attempting to recreate every native component like the camera/photo picker can be complex and impractical.