Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Commit 8b27afb

Browse files
satya164brentvatne
authored andcommitted
fix: drop custom history logic for isFirstRouteInParent (#52)
As the naming suggests, this checks if route is the first one in parent. So probably doesn't make sense to check history.
1 parent e514a61 commit 8b27afb

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/getChildNavigation.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,8 @@ function getChildNavigation(navigation, childKey, getCurrentParentNavigation) {
6060
const parentNavigation = getCurrentParentNavigation();
6161

6262
if (parentNavigation) {
63-
isFirstRouteInParent = parentNavigation.routeKeyHistory
64-
? // For navigators such as switch/tab navigators, history is separate from routes
65-
parentNavigation.routeKeyHistory.length
66-
? parentNavigation.routeKeyHistory.indexOf(childKey) === 0
67-
: true
68-
: // For stack navigator, list of routes is the same as the history
69-
parentNavigation.state.routes.indexOf(childRoute) === 0;
63+
isFirstRouteInParent =
64+
parentNavigation.state.routes.indexOf(childRoute) === 0;
7065
}
7166

7267
if (

0 commit comments

Comments
 (0)