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

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.

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

There seems to be a pull request for this but it’s dated a while ago close the drawer first by chirag04 · Pull Request #101 · expo/ex-navigation · GitHub. 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