React-native-router-flux: How to hide tabbar item in tabs

Created on 29 May 2018  路  7Comments  路  Source: aksonov/react-native-router-flux

Version

  • react-native-router-flux v4.0.0 (v3 is not supported)
  • react-native v0.45.1

Expected behaviour

222222

Actual behaviour

1527579578082

Steps to reproduce

In v3.0, I can create a scene without icon and tabContent, it will not show in tabbar,
but in v4.0.0, it will show an tab item with empty label and empty icon.

<Scene key="main" initial={true} tabs={true} >
  <Scene key="Home" component={Home} title={'TITLE'} />
  <Scene
    key="HotNews1"
    text="hotNews_title"
    icon={TabIcon}
    component={HotNewsPage}
    tabContent={{
      iconSource: ICON_1,
      selectedIconSource: SL_ICON_1
    }} />

  <Scene
    key="HotNews2"
    text="hotNews_title"
    icon={TabIcon}
    component={HotNewsPage}
    tabContent={{
      iconSource: ICON_1,
      selectedIconSource: SL_ICON_1
    }} />
</Scene>

All 7 comments

import { StatusBar} from 'react-native'; at top of your file and in your render() function
<StatusBar hidden={true} />
should work

Looks like v4 doesn't support it. PR is welcome (it should not be difficult to filter by icon and tabContent). But I really suggest you to change your nav hierarchy - move away Home if it is not part of tabbar.

@jie any progress here? i have the same issue.

@aksonov i have the same problem - how can i hide icon on menu any ideas?

@kr0000 I use custom tabbar instead

@jie did you extend react-navigation TabBarBottom? Do you mind posting the code for the custom tabbar you ended up using?

@RobinJayaswal
No, I don't use react-navigation,
here is the code:

                                <Scene
                                    key="main"
                                    initial={true}
                                    tabs={true}
                                    showLabel={false}
                                    tabBarComponent={TabBar}
                                    tabBarStyle={styles.tabBarStyle}
                                    tabBarPosition={"bottom"}
                                >

TabBar is a React.Component

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sreejithr picture sreejithr  路  3Comments

moaxaca picture moaxaca  路  3Comments

basdvries picture basdvries  路  3Comments

tonypeng picture tonypeng  路  3Comments

wootwoot1234 picture wootwoot1234  路  3Comments