Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

drawerLockMode : 'locked-closed' not working directly with createStackNavigator

$
0
0

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


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>