Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Support for Nested Navigators? #7

Open
joncursi opened this issue Apr 9, 2017 · 4 comments
Open

Support for Nested Navigators? #7

joncursi opened this issue Apr 9, 2017 · 4 comments

Comments

@joncursi
Copy link
Contributor

joncursi commented Apr 9, 2017

If I have a single stack Navigator, I don't get any runtime issues:

const SingleNavigator = enhance(StackNavigator)({
  ...
});

export default SingleNavigator;

But when I have multiple navigators nested, such as:

const AnotherNavigator = StackNavigator({
  ...
});

const MainNavigator = enhance(StackNavigator)({
  ...
  [key]: { screen: AnotherNavigator },
});

export default MainNavigator;

When I try to load up a route provided by AnotherNavigator I get the following runtime error:

screen shot 2017-04-09 at 2 32 21 pm

I tried wrapping just the main navigator in enhance, both navigators in enhance, but they produce the same error.

@satya164
Copy link
Owner

Can you try master and see if it still happens? Note that master compatible with react-navigation alpha.8

@ghuh
Copy link

ghuh commented Apr 22, 2017

I can confirm this is an issue on the latest master on both react-navigation (afe3c2be9ee1ada8ba37d2ccaed5a5f242e5ea07) and react-navigation-addons (9c58d89300d78ce0c42219d9ad5e304e8f3e6783).

I tried the obvious fix of checking if nextState.routes is defined before calling .forEach on it but that results in the following error:

Invariant Violation: there should always be only one scene active, not 0.
    at invariant (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:3193:15)
    at ScenesReducer (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:70758:27)
    at new Transitioner (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:70429:43)
    at http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:21515:18
    at measureLifeCyclePerf (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:21339:12)
    at ReactCompositeComponentWrapper._constructComponentWithoutOwner (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:21514:16)
    at ReactCompositeComponentWrapper._constructComponent (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:21500:21)
    at ReactCompositeComponentWrapper.mountComponent (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:21393:21)
    at Object.mountComponent (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:17765:35)
    at ReactCompositeComponentWrapper.performInitialMount (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:21566:34)

@jeffpc1993
Copy link

jeffpc1993 commented Sep 18, 2017

Will this be fixed anytime soon?

@nkov
Copy link

nkov commented Jan 26, 2018

+1, when using enhance on a StackNavigator I experience this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants