mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 17:34:59 +08:00
Fix withCachedChildNavigation recreating the child navigations each time (#201)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user