this is my first question on here, and maybe I am missing something simple but I cannot find my answer anywhere.
My project uses redux and has several "root" changes with both tabBasedApps and singleScreenApps. When using the drawer to deep link to a specific tab, if you are in the current tabBasedApp root, it will correctly go to the right tab with what I am using (below). But if you are in a different root of the application (tabs or single app) and have to change the root and then try to link to the correct tab - it doesn't work. It seems to skip over any navigator method and just print the console logs. So trying to get to "friends" from a different root just stops at "profile". I'm guessing it is a problem with the roots changing but I don't know.
Below is part of the event listener for the deep link. "appRoot" and "navigator" isn't "this.props..." because I am passing the nav event into a separate handler to reduce code duplication - it works with everything else I have tested, just not this (which I am assuming is not the handlers fault but I could be wrong).
I get a warning on iOS: Possible Unhandled Promise Rejection (id:0) Error: could not find UITabBarController Nothing on Android, it just doesn't work.
if(event.type === 'DeepLink') {
console.log('deeplink from nav');
const parts = event.link.split('/');
switch(parts[0]) {
case 'profile':
appRoot('profile');
if(parts[1] === 'profile') {
navigator.toggleDrawer({
side: 'left',
animated: true,
});
navigator.switchToTab({
tabIndex: 0
});
}
if(parts[1] === 'friends'){
navigator.toggleDrawer({
side: 'left',
animated: true,
});
navigator.switchToTab({
tabIndex: 1,
});
}
break;
Steps to Reproduce: Build project using the redux example to be able to switch between roots. Have drawer with a button to go to a specific tab in one of the root tabBasedApps Handle the deep link from the drawer
Environment React Native Navigation version: ^1.1.352 React Native version: 0.51.0 Platform(s) (iOS, Android, or both?): both Device info (Simulator/Device? OS version? Debug/Release?): simulators on both. iphone 6 and Pixel 2
Thank you for any help!