Fix withCachedChildNavigation recreating the child navigations each time (#201)

This commit is contained in:
Emiel Mols 2017-02-06 18:18:20 +01:00 committed by Satyajit Sahoo
parent 33767311ae
commit fa826bfe17

View File

@ -42,7 +42,9 @@ export default function withCachedChildNavigation<T: Props>(Comp: ReactClass<T>)
navigation: NavigationScreenProp<NavigationState, NavigationAction>
) => {
// Update props for each child route
this._childNavigationProps = {};
if (!this._childNavigationProps) {
this._childNavigationProps = {};
}
navigation.state.routes.forEach((route: *) => {
const childNavigation = this._childNavigationProps[route.key];
if (childNavigation && childNavigation.state === route) {