diff --git a/src/Navigation.tsx b/src/Navigation.tsx index fd36315b9e..374c80f4fb 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -499,6 +499,10 @@ function TabsNavigator() { tabBar={tabBar}> HomeTabNavigator} /> SearchTabNavigator} /> + MessagesTabNavigator} + /> NotificationsTabNavigator} @@ -507,10 +511,6 @@ function TabsNavigator() { name="MyProfileTab" getComponent={() => MyProfileTabNavigator} /> - MessagesTabNavigator} - /> ) } @@ -522,12 +522,12 @@ function HomeTabNavigator() { + }} + initialRouteName="Home"> HomeScreen} /> HomeScreen} /> {commonScreens(HomeTab as typeof Flat)} @@ -541,12 +541,12 @@ function SearchTabNavigator() { + }} + initialRouteName="Search"> SearchScreen} /> {commonScreens(SearchTab as typeof Flat)} @@ -559,12 +559,12 @@ function NotificationsTabNavigator() { + }} + initialRouteName="Notifications"> NotificationsScreen} @@ -581,12 +581,12 @@ function MyProfileTabNavigator() { + }} + initialRouteName="MyProfile"> + }} + initialRouteName="Messages"> MessagesScreen} @@ -639,7 +639,6 @@ const FlatNavigator = () => { screenListeners={screenListeners} screenOptions={{ animationDuration: 285, - gestureEnabled: true, fullScreenGestureEnabled: true, fullScreenGestureShadowEnabled: true, headerShown: false, @@ -777,7 +776,14 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) { logModuleInitTime() onReady() logger.metric('router:navigate', {}, {statsig: false}) - }}> + }} + // WARNING: Implicit navigation to nested navigators is depreciated in React Navigation 7.x + // However, there's a fair amount of places we do that, especially in when popping to the top of stacks. + // See BottomBar.tsx for an example of how to handle nested navigators in the tabs correctly. + // I'm scared of missing a spot (esp. with push notifications etc) so let's enable this legacy behaviour for now. + // We will need to confirm we handle nested navigators correctly by the time we migrate to React Navigation 8.x + // -sfn + navigationInChildEnabled> {children}