2

The drawer in react-navigation 3 (createDrawerNavigator) doesn't behave as expected.

  1. I added an icon that toggles the drawer. Clicking on it multiple times you expect the drawer to open/close smoothly, while what happens is that the drawer will fully open, then pause for another second and only then another click will close it.

  2. When open, let's say of 2/3 of the screen, you expect that clicking on the last 1/3 screen which doesn't include the drawer to close it - it doesn't.

Are these bugs or am I using it wrong?

user1235003
  • 91
  • 1
  • 4

1 Answers1

1

What does your code look like?

That's what I use to open the drawer, it works like a charm.

onPress={() => navigation.dispatch(DrawerActions.openDrawer())}

Make sure you have react-native-gesture-handler linked. (manual!): React Navigation: Swipe on drawer does not work in Android

Freddy
  • 442
  • 1
  • 5
  • 17
  • Thanks! These instructions solved the 2nd issue which works much better now. Still, toggle works pretty bad. My code: `onPress={() => navigation.dispatch(DrawerActions.toggleDrawer())}` but toggle is slow and you have to wait for it to end. I expected it to work smoother so one can click several time on toggle and the drawer will open/close and not stuck and wait to finish current action... – user1235003 Dec 19 '18 at 20:22
  • Glad I could fix one of the issues. But I haven't worked with toogle, sorry can't help with that. – Freddy Dec 19 '18 at 21:10