[Navigator] Nested Navigator causing pop to fail
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.
+1
Can confirm that I've came across this issue as well.
cc @ide, the other navigator expert
Maybe this is similar to my "solved" issue. Let's start with: https://github.com/facebook/react-native/issues/1159#issuecomment-99688706
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 :)
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, I tested this now on master, and can confirm the issue is resolved, many thanks.