kanzitelli / rn-navio

🧭 Navigation library for React Native (Expo). Build once, navigate from anywhere to everywhere!
https://snack.expo.dev/@kanzitelli/rn-navio-snack
MIT License
112 stars 5 forks source link

Drawer default props #31

Open URVL opened 5 months ago

URVL commented 5 months ago

In which section during initialization do I need to add these parameters for them to be applied? I haven't been able to get this to work yet (the goal is to disable opening the driwer by swiping)

swipeEdgeWidth: 0, swipeEnabled:false,

https://reactnavigation.org/docs/drawer-navigator/#swipeenabled

kanzitelli commented 5 months ago

Hi @URVL! Apologies for late reply, been busy lately.

It's pretty easy to achieve with Navio, you just need to provide options with swipe values when initialising a drawer. Please see the example below:

const navio = Navio.build({
  screens: { Home, Settings },
  stacks: { HomeStack: ['Home'], SettingsStack: ['Settings'] }
  drawers: {
    AppDrawer: {
       layout: {
         Home: {stack: 'HomeStack'},
         Settings: {stack: 'SettingsStack'},
       },
       options: {
         swipeEdgeWidth: 0,
         swipeEnabled: false,
       }
    }  
  }
})

Let me know if it helped!