简体   繁体   中英

How to disable react-navigation drawer in welcome and sign in screens

In those 2 screens when you swipe drawer appears while it should not be opened on those 2 screens. I am using react navigation. I tried this solution which I found on GitHub. But it's not working.

navigationOptions: ({navigation}) => ({
      drawerLockMode: 'locked-closed'

How can I solve this trouble?

You should be able to use

navigationOptions: ({navigation}) => ({
  swipeEnabled: false
});

I had the same issue and upon checking my drawer has nested stack within it and in the documentation you are required to do this to disable the drawers in some of your screen.

https://reactnavigation.org/docs/en/navigation-options-resolution.html#a-drawer-has-a-stack-inside-of-it-and-you-want-to-lock-the-drawer-on-certain-screens

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM