React-native-navigation: BottomTabs with Stack; Icon disappears after updating tab text

Created on 9 Mar 2019  ·  7Comments  ·  Source: wix/react-native-navigation

Issue Description

When I update the text of a bottom bar tab which is a stack, it loses its icon.
This does work properly on a 'plain' child without a stack.

Steps to Reproduce / Code Snippets / Screenshots

  Navigation.events().registerAppLaunchedListener(() => {
      Navigation.setRoot({
          root: {
            bottomTabs: {
              id: "BottomTabsId",
              children: [                
                {
                  stack: {
                    id: "MyScreenStackId",
                    children: [
                      {
                        component: {
                          id: "MyScreenId",
                          name: "Foo",
                          options: {
                            bottomTab: {
                              text: "Foo",
                              icon: icons.archive,
                              iconColor
                            },
                            topBar: {
                              visible: false,
                            }
                          }
                        }
                      }
                    ],
                  }
                },                
              ],
            }
          }
        }
      ).then();
    }
  );

Then call :

Navigation.mergeOptions("MyScreenId", {bottomTab: {text: "Bar"}});

The text is updated on the tab, but the icon disappears.
The current workaround I apply is :

Icon.getImageSource("ios-archive", 30).then((icon: number) => {
  Navigation.mergeOptions("MyScreenId", {
    bottomTab: {
      text: "Bar",
      icon,
      iconColor: "#6177cc"
    }
  });
});

Environment

  • React Native Navigation version: ^2.13.1
  • React Native version: 0.59.0-rc.3
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator and Real Device (iPhone XR)
🏚 stale

All 7 comments

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.

The issue has been closed for inactivity.

Same problem here

Same problem here as well!!! any ideas? what is going on? i just change currentTabIndex and sometimes my bottomTabs will disappear. (iOS)

same issue, any solution? (IOS)

the same issue. having it only for the 'release' target. Any help?

Anyone find any solution? I'm also having same issue

Was this page helpful?
0 / 5 - 0 ratings