Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide navigation bar in NavigatorIOS component (react-native) doesn't work after RN update

I had recently upgraded my react native project from ~0.28 to the most recent version (0.43.2) and for some reason my navigation bar no longer hides for me.

Here is the code (it is sitting in a TabBarIOS component):

    <TabBarIOS.Item
      selected={this.state.selectedTab === 'home'}
      title='Home'
      icon={require ('./Icons/IconImages/HomeTabIcon.png')}
      onPress={
        () => this._tabPressed('home')
      }>
      <NavigatorIOS
        style={styles.container}
        ref="nav"
        interactivePopGestureEnabled={false}
        initialRoute={{
          title: 'Home',
          component: HomeNavigationController,
          navigationBarHidden: true, //this does nothing now
          showTabBar: false, //this is to hide the bottom tabBar
          passProps: {
            ...
          },
        }}/>
      </TabBarIOS.Item>

Adding it outside initialRoute also does not work:

          <NavigatorIOS
        style={styles.container}
        ref="nav"
        interactivePopGestureEnabled={false}
        initialRoute={{
          title: 'Home',
          component: HomeNavigationController,
          showTabBar: false,
          passProps: {...},
        }}
        navigationBarHidden={true} // does not work
        />
like image 583
Michael Campsall Avatar asked Oct 29 '22 09:10

Michael Campsall


1 Answers

So, after trying to isolate the problem by stripping out everything and reducing it to its most basic form, I realized that it the problem wasn't in any code that I could find.

I initialized a new project from scratch and then re-added all my components and now it works just fine.

like image 162
Michael Campsall Avatar answered Nov 02 '22 23:11

Michael Campsall