How to exclusively navigate to a route other than the default route in react-navigation via deeplink

I have a react-navigation navigator created as:

createStackNavigator({
  a: {},
  b: {}
}, { initialRouteName: 'a' });

The default route “a” has some sideEffects on mount.

Now what I want is that when I open a deeplink to go directly to route “b”, route “a” is getting mounted first, since it’s the default route, and then it takes me to route “b”. But the problem is that I don’t want to execute the side-effects of route “a”. Is there any to exclusively open only the route “b”?

Go to Source
Author: mohsinulhaq