Skip to content

Commit

Permalink
refactor: rename reduce accumulator variable
Browse files Browse the repository at this point in the history
  • Loading branch information
oltrep authored and satya164 committed Sep 10, 2020
1 parent a57e477 commit b9ecbd2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/core/src/navigators/createNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ function createNavigator(NavigatorView, router, navigationConfig) {
);
}

const descriptors = routes.reduce((acc, route) => {
const descriptors = routes.reduce((descriptors, route) => {
if (
prevDescriptors &&
prevDescriptors[route.key] &&
route === prevDescriptors[route.key].state &&
screenProps === currentState.screenProps &&
currentState.themeContext === currentState.theme
) {
acc[route.key] = prevDescriptors[route.key];
return acc;
descriptors[route.key] = prevDescriptors[route.key];
return descriptors;
}
const getComponent = router.getComponentForRouteName.bind(
null,
Expand All @@ -57,14 +57,14 @@ function createNavigator(NavigatorView, router, navigationConfig) {
screenProps,
currentState.themeContext
);
acc[route.key] = {
descriptors[route.key] = {
key: route.key,
getComponent,
options,
state: route,
navigation: childNavigation,
};
return acc;
return descriptors;
}, {});

return { descriptors, screenProps, theme: state.themeContext };
Expand Down

0 comments on commit b9ecbd2

Please sign in to comment.