1

I am trying to hide the header in the React-native app. As far as I know, there are several ways to hide header in stack navigator.

const NavigatorsContainer = createStackNavigator({
  App: {
    screen: BottomTabStack,
    navigationOptions: {
      headerShown: false
    }
  },
  General: {
    screen: GeneralStack,
    navigationOptions: {
      headerShown: false
    }
  }
})

Then which case can I use the following method?

  General: {
    screen: GeneralStack,
    navigationOptions: {
      headerShown: false,
      //header: null,          //-- ?
      //headerMode: 'none',    //-- ?
      //headerVisible: 'none'  //-- ?
    }
  }

What is the difference between each other?

SatelBill
  • 641
  • 2
  • 12
  • 28

1 Answers1

0

To disable header for a particular screen, (I suppose GeneralStack in your case), use this in that particular screen component .js file!

GeneralStack.navigationOptions=()=>{
    return {
        header:()=>null
    };
};
Sagar Kulkarni
  • 483
  • 4
  • 15