Skip to content

Commit 608217a

Browse files
Agontukskevy
authored andcommitted
DrawerNav: don't push screen to stack if it's already focused (react-navigation#1817)
1 parent c61d72f commit 608217a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/views/Drawer/DrawerSidebar.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ class DrawerSidebar extends PureComponent<void, Props, void> {
7575
return null;
7676
};
7777

78-
_onItemPress = ({ route }: DrawerItem) => {
78+
_onItemPress = ({ route, focused }: DrawerItem) => {
7979
this.props.navigation.navigate('DrawerClose');
80-
this.props.navigation.navigate(route.routeName);
80+
if (!focused) {
81+
this.props.navigation.navigate(route.routeName);
82+
}
8183
};
8284

8385
render() {

0 commit comments

Comments
 (0)