Search code examples
react-nativereact-navigationtabnavigator

How to hide the title of react navigation's TabNavigator I would like to show only Icon


Inside screen i managed to hide title by setting it to empty like below

static navigationOptions = {
  title: "" 
};

but for every screen i have to set title as empty i was wondering if there is any property to hide titles by default and only show icons ?


Solution

  • Referring to react-navigations documentation, you can use showLabel in tabBarOptions to hide the label. Default is set to true.

    TabNavigator(
            {
              MyScreen: { screen: MyScreen }
            },
            {
              tabBarOptions: {
                showLabel: false,
                showIcon: true
              }
            }
          )