diff --git a/src/components/Navigation/TopLevelNavigationTabBar/getIsScreenWithNavigationTabBarFocused.ts b/src/components/Navigation/TopLevelNavigationTabBar/getIsScreenWithNavigationTabBarFocused.ts index 8a5664e31352..a7508da770d8 100644 --- a/src/components/Navigation/TopLevelNavigationTabBar/getIsScreenWithNavigationTabBarFocused.ts +++ b/src/components/Navigation/TopLevelNavigationTabBar/getIsScreenWithNavigationTabBarFocused.ts @@ -6,9 +6,10 @@ import SCREENS_WITH_NAVIGATION_TAB_BAR from './SCREENS_WITH_NAVIGATION_TAB_BAR'; function getIsScreenWithNavigationTabBarFocused(state: NavigationState) { const focusedRoute = findFocusedRoute(state); + const routeName = focusedRoute?.params && 'screen' in focusedRoute.params ? (focusedRoute.params.screen as string) : focusedRoute?.name; // We are checking if the focused route is a split navigator because there may be a brief moment where the navigator doesn't have state yet. // That mens we don't have screen with bottom tab focused. This caused glitching. - return SCREENS_WITH_NAVIGATION_TAB_BAR.includes(focusedRoute?.name ?? '') || isSplitNavigatorName(focusedRoute?.name); + return SCREENS_WITH_NAVIGATION_TAB_BAR.includes(routeName ?? '') || isSplitNavigatorName(routeName); } export default getIsScreenWithNavigationTabBarFocused;