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

[FEAT] Statically switching tabs

Open MaxMaes opened this issue 7 years ago • 3 comments

Issue Description

I have a screen with 4 tabs, but upon selecting the last tab I need to hide the tabbar so the screen kind of appears as an overlay. When I close that screen, I need to navigate back to the previously selected tab.

In my current setup, I store the previously selected screen and want to switch the tab using mergeOptions. But when I use mergeOptions, the tabbar is still hidden on the other screen. So, ok, can make it visible for that screen again when I also set it to visible in the mergeOptions, which works. But when I go back to my 'overlay tab', the tabbar doesn't hide.

I have a specific static options setup for each of my tab screens, so it is very tedious to be working with mergeOptions for switching tabs.

Would it be possible to add a top level API for selecting a tab, eg Navigation.selectTabIndex and/or Navigation.selectTabId where the statically declared options of the screen are applied upon opening said screen?

Environment

  • React Native Navigation version: 2.7.1
  • React Native version: 0.57.8
  • Platform(s) (iOS, Android, or both?): Both
  • Device info (Simulator/Device? OS version? Debug/Release?): All

MaxMaes avatar Jan 23 '19 15:01 MaxMaes

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

stale[bot] avatar Feb 22 '19 15:02 stale[bot]

This has been added by @RemyLivewall, not stale?

MaxMaes avatar Feb 22 '19 15:02 MaxMaes

Closing, see https://github.com/wix/react-native-navigation/pull/4739#issuecomment-468293356

guyca avatar Feb 28 '19 14:02 guyca