fix: getScreen getting called for each route on init (#62)

This commit is contained in:
Janic Duplessis
2019-05-21 17:47:50 -04:00
parent eff177e443
commit 720f943fcf

View File

@@ -30,7 +30,9 @@ export default (routeConfigs, stackConfig = {}) => {
// Loop through routes and find child routers
routeNames.forEach(routeName => {
const screen = getScreenForRouteName(routeConfigs, routeName);
const routeConfig = routeConfigs[routeName];
const screen =
routeConfig && routeConfig.screen ? routeConfig.screen : routeConfig;
if (screen && screen.router) {
// If it has a router it's a navigator.
childRouters[routeName] = screen.router;