Skip to content

[Android] Tab content stays blank after navigating away and back over a PagerView (regression 8.0.5 → 9.0.2) #1103

Description

@GaelCO

Environment

  • react-native-pager-view: 9.0.2 (last working version: 8.0.5)
  • @react-navigation/material-top-tabs: 7.6.15 (react-native-tab-view 4.3.2)
  • react-native: 0.86.2
  • react: 19.2.3
  • Platform: Android
  • New architecture: enabled

Description

A screen using createMaterialTopTabNavigator (even with a single tab, so a single-page PagerView) goes blank after the user navigates to another screen pushed on top via a Stack.Navigator, then navigates back. The tab bar and navigation state are still correct, but the page content is empty — no swipe/resize recovers it.

Bisected on our end: reverting only react-native-pager-view from 9.0.2 to 8.0.5 (no other change) fixes it, so this is a regression introduced in 9.0.0. That release replaced the Android implementation from ViewPager2/RecyclerView with a Jetpack Compose HorizontalPager (ComposePagerView, #1092). Suspicion: the Compose-hosted page doesn't get a fresh re-composition/re-layout when the surrounding Fragment/Activity view is covered by another screen and then revealed again.

Reproducible Demo

  1. Screen A is a createMaterialTopTabNavigator with a single tab rendering some content (a PagerView under the hood, even with just 1 page).
  2. From that tab's content, navigate forward to a screen pushed on a Stack.Navigator on top of it.
  3. Navigate back (pop the stack screen) to Screen A.
  4. The tab's content area is blank — the PagerView page no longer renders anything, even though the tab bar/navigation state is correct. No user interaction (swipe/resize) recovers it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions