You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I reset a nested stack to its initial route when navigating back to its parent navigator?
When I've got a stack like this:
Home
Intro
User
Form1
Form2
Form3
I navigate from User -> Form1 -> Form2 -> Form3 -> Home.Then when I want to navigate to the Form1 screen again I see the Form3 first for a short time (only on iOS), then Form1 is opened. I want to be able to directly show Form1. I need a way to reset the nested stack when I navigate from Form3 to Home.
If I'm correct the way to do this, is using the reset action. Which has a big "warning" message there so I hope to avoid that approach if possible. This solution seems to work, however it also unmounts/mounts my component which I would like to prevent.
Is there a way to reset a nested stack navigator back to its initial route when I go back from the nested navigator to the parent one? (e.g. from Form3 to Home/Intro/User)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How can I reset a nested stack to its initial route when navigating back to its parent navigator?
When I've got a stack like this:
I navigate from
User -> Form1 -> Form2 -> Form3 -> Home
.Then when I want to navigate to theForm1
screen again I see theForm3
first for a short time (only on iOS), thenForm1
is opened. I want to be able to directly showForm1
. I need a way to reset the nested stack when I navigate fromForm3
toHome
.If I'm correct the way to do this, is using the reset action. Which has a big "warning" message there so I hope to avoid that approach if possible. This solution seems to work, however it also unmounts/mounts my component which I would like to prevent.
Is there a way to reset a nested stack navigator back to its initial route when I go back from the nested navigator to the parent one? (e.g. from
Form3
toHome/Intro/User
)?Beta Was this translation helpful? Give feedback.
All reactions