When I specify drawerLockMode
direactly with createStackNavigator
it is not working.
const drawerStack = createStackNavigator({ HomeScreen: { screen: HomeScreen },}, { headerMode: 'screen', navigationOptions: { drawerLockMode:'locked-closed' }})
But when I use drawerStack
variable to define navigationOptions
, it is working.
drawerStack.navigationOptions = ({ navigation }) => { drawerLockMode = 'locked-closed'; return { drawerLockMode, };};
Am I doing any mistake when I am directly using it inside createStackNavigator
?
Update
As @bennygenel suggested, we need to user drawerLockMode in drawerNavigator instead of stackNavigator. Here is what i have done.
const drawerNavigator = createDrawerNavigator({ drawerStack: drawerStack}, { contentComponent: DrawerComponent, navigationOpions:{ drawerLockMode:'locked-closed' }})
But it is not working in this way also. The only way it is working is by using the const
variable created using createStackNavigator
or createDrawerNavigator