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.
This commit is contained in:
Satyajit Sahoo
2019-04-10 19:14:05 +02:00
parent 3a1f1e0df4
commit 9434cfa418

View File

@@ -60,13 +60,8 @@ function getChildNavigation(navigation, childKey, getCurrentParentNavigation) {
const parentNavigation = getCurrentParentNavigation();
if (parentNavigation) {
isFirstRouteInParent = parentNavigation.routeKeyHistory
? // For navigators such as switch/tab navigators, history is separate from routes
parentNavigation.routeKeyHistory.length
? parentNavigation.routeKeyHistory.indexOf(childKey) === 0
: true
: // For stack navigator, list of routes is the same as the history
parentNavigation.state.routes.indexOf(childRoute) === 0;
isFirstRouteInParent =
parentNavigation.state.routes.indexOf(childRoute) === 0;
}
if (