Skip to content

[iOS] TabView does not switch tabs / snaps back even though index updates #1068

@hcrnln

Description

@hcrnln

Environment

  • react-native: 0.77
  • react-native-tab-view: 4.0.5
  • react-native-pager-view: 7.0.2 (also tried 6.9.1)
  • Platform: iOS
  • New Architecture: Enabled

Description

On iOS, tabs do not switch correctly when using react-native-tab-view with react-native-pager-view.

onIndexChange is triggered and the state index updates correctly, but the UI does not stay on the selected tab.

Observed behavior:

  • pressing a tab does not visibly switch to that tab
  • swiping sometimes looks like it changes page briefly, then snaps back to the first tab
  • Android works as expected with the same code

Expected behavior

When a tab is pressed or swiped to, the selected tab should stay active and the scene should update correctly.

Actual behavior

On iOS:

  • tab press triggers onIndexChange
  • state updates
  • but the visible page does not remain on the selected tab
  • sometimes it briefly changes and returns back to the first tab

Notes

  • Android works correctly
  • issue reproduced on iOS
  • New Architecture is enabled
  • upgrading/downgrading app-side code paths did not resolve it
  • side effects inside onIndexChange were removed for testing, but the issue still persisted

Additional notes

  • I also tested the latest react-native-pager-view version.
  • On iOS, that version threw: Unimplemented component <RNCViewPager>.
  • Because of that, I downgraded back to 7.0.2 for testing.
  • The tab switching issue still persists on 7.0.2.

Question

Is this a known iOS/New Architecture regression with react-native-pager-view 7.0.2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: Needs ReproThis issue could be improved with a demo to reproduce the issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions