-
DescriptionIn React Navigation v7, the With old navigate behavior:If route exists in history: go back to it (like popTo) With popTo:If route exists in history: go back to it (works as expected) QuestionHow can we replicate the old behavior for non-existent routes? Specifically, when navigating to a screen that doesn't exist in history, how can we push it without clearing the existing history? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That's not what You can replicate the behavior of the old navigate with a navigation.navigate({ name: 'ScreenName', params: {..}, pop: true }) |
Beta Was this translation helpful? Give feedback.
That's not what
popTodoes. It only replaces the current route (i.e., pops the current route and adds the new route) when adding a non-existent route, not clearing the entire history.You can replicate the behavior of the old navigate with a
popoption in the latest version: