Navigation drawer closes only after the network call or something. Can we programatically close navigation drawer before? (ExNavigation)

#1

I am making a network call on componentWillRecieve(), which leads me to the issue with navigation drawer closing very slow. I think, it is being closed after the network call only.

0 Likes

#2

Can you share a code example to better understand the problem?

0 Likes

#3

There seems to be a pull request for this but it’s dated a while ago https://github.com/expo/ex-navigation/pull/101. You can probably fix it by getting the drawer navigator and using the toggleDrawer() method to close the drawer, then make your network call. Like so,
const drawerNavigator = this.props.navigation.getNavigator('drawer') and drawerNavigator.toggleDrawer().

1 Like