Skip to content

Commit eef9efc

Browse files
JS00001OSBotify
authored andcommitted
Merge pull request #89269 from software-mansion-labs/war-in/fix-missing-FAB
fix: always show FAB on the root-level (cherry picked from commit d5d9403) (cherry-picked to staging by arosiclair)
1 parent 58ed833 commit eef9efc

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/libs/Navigation/AppNavigator/Navigators/TabNavigatorBar.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ function TabNavigatorBar({state}: Pick<BottomTabBarProps, 'state'>) {
5555
const StyleUtils = useStyleUtils();
5656
const activeRoute = state.routes[state.index];
5757
const selectedTab = ROUTE_TO_NAVIGATION_TAB[activeRoute?.name ?? SCREENS.HOME] ?? NAVIGATION_TABS.HOME;
58-
// Check both leaves so wrapper hydration doesn't flash the tab bar on the push target (Android).
59-
const isAtRoot = isAtTabRootLevel(getFocusedLeafScreenName(activeRoute?.state)) && isAtTabRootLevel(getPushTargetLeaf(activeRoute?.params));
58+
// Trust the focused leaf as the source of truth. Fall back to the push target only when the navigator
59+
// state hasn't hydrated yet (Android), so the tab bar doesn't flash on the push target during the transition.
60+
// Tab-level params can be stale after within-tab back navigation, so they must not override an already-hydrated focused leaf.
61+
const focusedLeaf = getFocusedLeafScreenName(activeRoute?.state);
62+
const isAtRoot = isAtTabRootLevel(focusedLeaf ?? getPushTargetLeaf(activeRoute?.params));
6063
// --- Narrow-only animation logic (hooks must run unconditionally per Rules of Hooks) ---
6164
// On native, screens also render the tab bar via bottomContent for swipe-back animations.
6265
// Delay showing this navigator's tab bar only when navigating back from a deeper screen

0 commit comments

Comments
 (0)