Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation not working in Nested Navigator #913

Closed
InteractiveLogic opened this issue Apr 4, 2017 · 3 comments
Closed

Navigation not working in Nested Navigator #913

InteractiveLogic opened this issue Apr 4, 2017 · 3 comments

Comments

@InteractiveLogic
Copy link

Conceptually, this is roughly the structure I'm using:

  • Stack Navigator 1
    • Screen 1
    • Screen 2
    • Tab Navigator
      • Tab 1 Stack Navigator
        • Tab 1 - Screen 1
      • Tab 2 Stack Navigator
        • Checklist
        • Zone
        • Info
        • Select
        • Measurements
    • Screen 3-5

After much work thus far, and using the technique in #335 I can navigate from Stack Navigator 1 to the Checklist, contained by the Tab Navigator.

Once at the Checklist, I can navigate to any of the "peer" screens with no issues (and can navigate back as well, by doing the technique of using setParams to wire up an onBackButtonPress instance method as an event handler).

So the weird thing is that if I navigate to the Checklist screen, and then do the following from that screen:


    this.props.navigation.navigate({
      name: 'Measurements',
    });

...no navigation occurs. (sad trombone sound)

If I debug and inspect at the point of the method call, I have a navigation object, and it has a navigate method, but for some reason it's not actually performing the navigation.

Any ideas on what might be going on here?

@InteractiveLogic InteractiveLogic changed the title Navigation not working past 2 screens Navigation not working in Nested Navigator Apr 4, 2017
@InteractiveLogic
Copy link
Author

OK I think I have this one solved for the time being.

Even though this.props.navigation.navigate() doesn't work, this.props.navigation.dispatch() does.

I discovered this by trying out this.props.navigation.goBack() just for kicks, and it worked... So the next step was to just use dispatch() (which I probably should have tried first... oh well).

Anyway I appear to be unblocked and will report back if I encounter any more funny business.

@mkozhukharenko
Copy link

After much work thus far, and using the technique in #335 I can navigate from Stack Navigator 1 to the Checklist, contained by the Tab Navigator.

@InteractiveLogic how did you manage to do so? I tried all approaches listed in #335 but neither works

@beausmith
Copy link

@InteractiveLogic Found this Issue when looking for a solution. Ultimately this solution worked for my similar use case:
#1127 (comment)

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

No branches or pull requests

3 participants