0

I am looking for a way to hide the tabbar on the first tab only for my app.

[EDIT FOR MORE DETAILS]

I have tried this:

Navigation.setRoot({
root: {
  bottomTabs: {
    id: "BottomTabsId",
    children: [
      {
        stack: {
          children: [
            {
              component: {
                name: "HomeScreenController",
                passProps: {
                  client,
                  user
                }
              }
            }
          ],
          options: {
            bottomTabs: {
              visible: false,
              drawBehind: true,
              translucent: true
            },
            bottomTab: {
              text: _strings.home,
              icon: _images.tabIcons.home,
              testID: "FIRST_TAB_BAR_BUTTON"
            }
          }
        }
      }, ...

the result is that the tab bar shows on the initial screen and then actually hides when I switch to another tab (switching is done programmatically) with is the opposite of what I want.

I have also tried using setRoot between a stack and bottomTabs. I then have a component at index0 that just listens for a tab switch to index 0 which then does a setRoot to go to the stack layout. From within the stack layout i have buttons to setRoot back to the bottomTabs at the chosen index. The trouble with this is that it needs to reload the app every time I setRoot and it is a tad slower than it needs to be. Also, the component that I have listening for tab switches does not seem to leave memory, and a console.log I put in there just keeps stacking up each time i call setRoot.

Michael Campsall
  • 4,325
  • 11
  • 37
  • 52
  • What have you tried so far? – Jose Vf Dec 12 '18 at 19:15
  • @JoseVf, I have added some more details above – Michael Campsall Dec 12 '18 at 19:40
  • Apparently this is not supported anymore: "This isn't supported anymore. BottomTabs can be toggled only when pushing and popping screens. Toggling their visibility programatically is no longer supported on iOS as it's not officially supported by the system." https://github.com/wix/react-native-navigation/issues/4439#issuecomment-446712801 – Michael Campsall Dec 12 '18 at 20:40

0 Answers0