I want to toggle between sidebar and tab navigation. I have it so that it currently switches between tabs and sidebar depending on the screen size, however since they are separate navigators it resets the navigation stack. Is there any way to persist the navigation stack when I change navigators?
If there is a way to have a Drawer and TabBar navigator with the same screens at the same time that would also solve my problem.
<Stack.Navigator
screenOptions={{ headerShown: false }}
mode="modal"
initialRouteName="WalkthroughScreen"
>
{deviceSize(layout.width) > 0 ||
(layout.width < 50 && Platform.OS === 'web') ? (
<Stack.Screen name="Root" component={DrawerNavigator} />
) : (
<Stack.Screen name="Root" component={BottomTabNavigator} />
)}