Skip to content

Commit d5040a3

Browse files
committed
Add explanation to setShouldPopAllStateOnUP(true) in NavigationRoot
1 parent 9843e13 commit d5040a3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libs/Navigation/NavigationRoot.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ function NavigationRoot({authenticated, lastVisitedPath, initialUrl, onReady}: N
167167
return;
168168
}
169169

170+
// After resizing the screen from wide to narrow, if we have visited multiple central screens, we want to go back to the LHN screen, so we set shouldPopAllStateOnUP to true.
171+
// Now when this value is true, Navigation.goBack with the option {shouldPopToTop: true} will remove all visited central screens in the given tab from the navigation stack and go back to the LHN.
172+
// More context here: https://github.com/Expensify/App/pull/59300
170173
if (!shouldUseNarrowLayout) {
171174
return;
172175
}

0 commit comments

Comments
 (0)