0

when I'm trying to navigate to the Screen using Drawer. after clicking on the Drawer Label. it's navigating me to the screen but the Drawer is not closing. but when I'm clicking again on Drawer it's closing.

I think it's happing when I'm using navigation.setParams in the ComponentDidMount. without setting the Params it's working fine and the drawer is closing immediately. but I want to set the Params.

Does anyone have Solutions?

1 Answers1

0

This seems to be a bug with react-navigation. A workaround for this is to use a timeout with delay of 0.

setTimeout(() => {
  () => {
    //use setParams here
  };
}, 0);

This works for now until a better solution is found

Vishal Ambre
  • 403
  • 4
  • 9