I have the following navigation structure in my app:
<NavigationContainer ref={navigationRef} linking={linking}>
<AppNavigator.Navigator>
<AppNavigator.Screen name={RouteNames.bottomTabNav} component={BottomTabNavigator} />
<AppNavigator.Screen name={RouteNames.mainStackNav} component={MainNavigator} />
</AppNavigator.Navigator>
</NavigationContainer>
First screen is actually tab bar navigator, and the second one is stack navigator.
Is it possible that, when I am navigating to some screen in main stack nav through deeplink, simultaneously set the screen in tab bar navigator?
I tried something like:
const linking = {
prefixes: ['#####'],
config: {
// initialRouteName: { [RouteNames.bottomTab]: { screens: RouteNames.profile } },
initialRouteName: RouteNames.bottomTab,
screens: {
[RouteNames.main]: {
screens: {
[RouteNames.settings]: RouteNames.settings,
},
},
},
},
};
The commented line is what I want (to navigate to profile screen inside tab bar navigator), but that is not working.