Skip to content

Commit d8ecd9b

Browse files
committed
BackNavigationHandler [nfc]: Comment on our use of navigateBack.
BackNavigationHandler is no longer necessary to support `react-navigation-redux-helpers`, which we recently removed, but it does this other important thing that's easy to forget about. So, make a note. As Greg says [1], we may want to change the behavior as part of a UI redesign; it's not particularly intuitive. [1] #4278 (comment)
1 parent 5d20a30 commit d8ecd9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/nav/BackNavigationHandler.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ export default class BackNavigationHandler extends PureComponent<Props> {
2222
handleBackButtonPress = () => {
2323
const canGoBack = NavigationService.getState().index > 0;
2424
if (canGoBack) {
25-
NavigationService.dispatch(navigateBack());
25+
NavigationService.dispatch(
26+
// Our custom "go-back" action. If this is changed to align
27+
// with React Navigation's natural "go-back" behavior, this
28+
// whole component can go away.
29+
navigateBack(),
30+
);
2631
}
2732
return canGoBack;
2833
};

0 commit comments

Comments
 (0)