react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Navigator] Nested Navigator causing pop to fail

Open mattds opened this issue 11 years ago • 6 comments

Hi, I've recently updated to a more recent version of react-native and the navigation in the app I'm developing no longer behaves as expected. I've reproduced the issue: https://rnplay.org/apps/EK9ttQ

  • I have a top level Navigator which contains a tab bar of other components which themselves have Navigators.
  • When pushing a scene on one tab (pressing the "Next" button), then going to the other tab and back again to the first tab the pop functionality (pressing the "Back" button) no longer works on the first tab.
  • If I remove the outer navigator it works, so I think it has something to do with having a parent navigator, any help resolving this would be appreciated, thanks.

mattds avatar Jun 05 '15 21:06 mattds

+1

Can confirm that I've came across this issue as well.

christopherdro avatar Jun 06 '15 17:06 christopherdro

cc @ide, the other navigator expert

brentvatne avatar Jun 06 '15 17:06 brentvatne

Maybe this is similar to my "solved" issue. Let's start with: https://github.com/facebook/react-native/issues/1159#issuecomment-99688706

JonasJonny avatar Jun 07 '15 06:06 JonasJonny

Thanks @JonasJonny. The issue seems to be one and the same. I would add to the original issue that this wasn't an issue as of version 0.3.4, which was the version I recently upgraded from. I think this is quite a common use case, so I'm hesitant to use a workaround if a fix is possible, hopefully there is one in the pipeline :)

mattds avatar Jun 08 '15 16:06 mattds

Contextual navigation within the Navigator component was getting very complicated, so I removed it: https://github.com/facebook/react-native/commit/4690983c10a60d84a98a2a6f8bdf9a1c39d2ef74

We will be adding back contextual navigation pretty soon, but right now you can use nested navigators manually by referring to navigator.parentNavigator.

So I think this issue should be resolved on master. Let me know if its still problematic

ericvicenti avatar Jun 12 '15 21:06 ericvicenti

@ericvicenti, I tested this now on master, and can confirm the issue is resolved, many thanks.

mattds avatar Jun 13 '15 18:06 mattds