Fix leak in createNavigator

Previous descriptors had been retained because this binding caused `this.prevState` to remain referenced. This binds the component getter to null instead.
This commit is contained in:
Eric Vicenti
2018-07-19 12:20:56 -07:00
parent 8ee0e09092
commit ba1f912907

View File

@@ -36,8 +36,10 @@ function createNavigator(NavigatorView, router, navigationConfig) {
descriptors[route.key] = prevDescriptors[route.key];
return;
}
const getComponent = () =>
router.getComponentForRouteName(route.routeName);
const getComponent = router.getComponentForRouteName.bind(
null,
route.routeName
);
const childNavigation = navigation.getChildNavigation(route.key);
const options = router.getScreenOptions(childNavigation, screenProps);
descriptors[route.key] = {