mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-10 22:47:02 +08:00
fix: getScreen getting called for each route on init (#62)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user