I can do this in two ways: navigator.immediatelyResetRouteStack([routes.home]) and navigator.push(routes.home). In the first implementation, the login scene will be uninstalled, but I did not get the benefits of the scene transition. In the second implementation, I get a scene transition, but the login route will not be uninstalled, even if I don’t need to transition back to it.
Is there a way to achieve the “push and uninstall last time” conversion?
I am using React Native app and implemented with cross-platform Navigator. In an instance, I have a scenario, “login” route, when the user successfully logs in, I want to push to Another scenario, the “home” route.
I can do this in two ways: navigator.immediatelyResetRouteStack([routes.home]) and navigator.push(routes.home). In the first implementation, the login scene will be uninstalled, but I did not get the benefits of the scene transition. In the second implementation, I get a scene transition, but the login route will not be uninstalled, even if I don’t need to transition back to it.
Is there a way to achieve the “push and uninstall last time” conversion?
RouteStack is an array of all scenes. How to delete it from the array after conversion?