Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[iOS 15] Tab indicator does not update when switching pages after SwiftUI migration (v8)

Đang mở
#1,080 2 bình luận 3 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@d-mato đang làm issue này rồi.

Từ ngày 14/10/2026.

  • #1179 của @d-mato — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
ios, react-native, swift, typescript
Lĩnh vực
mobile

Hướng nghiên cứu

Tái hiện vấn đề bằng bản demo được liên kết và trình mô phỏng iOS 15, sau đó so sánh với iOS 16 hoặc mới hơn. Đọc PagerViewProps.swift và phần di chuyển sang SwiftUI được thảo luận trong PR #1020, tập trung vào state được báo cáo và việc truyền sự kiện. Công việc được hoàn tất khi indicator đi theo trang đang hiển thị trên iOS 15, trong khi hành vi hiện tại vẫn đúng trên các phiên bản mới hơn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

ios

Environment

Version
react-native-pager-view 8.0.1
react-native-tab-view 4.1.2
@react-navigation/native 7.2.4
@react-navigation/bottom-tabs 7.16.1
@react-navigation/native-stack 7.15.1
@react-navigation/stack 7.9.2
@react-navigation/elements 2.9.18
react-native-screens 4.25.0
react-native 0.84.1
iOS 15.x

Description

After upgrading to v8.0.0 (SwiftUI rewrite), the tab indicator (active tab highlight) no longer updates on iOS 15 when switching pages. The page content switches correctly, but the tab bar UI stays on the originally selected tab.

Downgrading to v7.0.2 resolves the issue immediately, which strongly suggests a regression introduced by the SwiftUI migration.

iOS15

https://github.com/user-attachments/assets/e842d9b5-e5f0-404c-ada7-d975d088cdab

iOS26.5

https://github.com/user-attachments/assets/da1c2566-c61f-453c-9841-f634fa3ace25

Reproducible Demo

https://github.com/manakuro/react-native-pager-view-ios15-issue

1. Set up an iOS 15 simulator

An iOS 15 simulator runtime is required. If you don't have one:

  1. Open Xcode
  2. Go to Xcode → Settings → Platforms
  3. Click + and download iOS 15.x
  4. Once downloaded, open Window → Devices and Simulators → Simulators
  5. Click + to add a new simulator, choose any device (e.g. iPhone 13) with the iOS 15 runtime
2. Run the demo
git clone https://github.com/manakuro/react-native-pager-view-ios15-issue.git
cd react-native-pager-view-ios15-issue
yarn install
cd ios && pod install && cd ..
npx react-native run-ios --simulator "iPhone 13 (iOS 15)"
import * as React from 'react';
import { View, useWindowDimensions } from 'react-native';
import { TabView, SceneMap } from 'react-native-tab-view';
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';

const FirstRoute = () => (
  <View style={{ flex: 1, backgroundColor: '#ff4081' }} />
);

const SecondRoute = () => (
  <View style={{ flex: 1, backgroundColor: '#673ab7' }} />
);

const renderScene = SceneMap({
  first: FirstRoute,
  second: SecondRoute,
});

const routes = [
  { key: 'first', title: 'First' },
  { key: 'second', title: 'Second' },
];

export default function App() {
  const layout = useWindowDimensions();
  const [index, setIndex] = React.useState(0);

  return (
    <SafeAreaProvider>
      <SafeAreaView style={{ flex: 1 }}>
        <TabView
          navigationState={{ index, routes }}
          renderScene={renderScene}
          onIndexChange={setIndex}
          initialLayout={{ width: layout.width }}
        />
      </SafeAreaView>
    </SafeAreaProvider>
  );
}

Expected behavior

The tab indicator moves to the tapped tab, matching the displayed page content.

Actual behavior

The page content switches correctly, but the tab indicator remains on the original tab. The tab bar UI and the actual page are out of sync.

Reproduction

Reproducible with the standard react-native-tab-view setup on iOS 15. Confirmed working correctly on iOS 16 and above.

Possible cause

During the PR review for the SwiftUI migration (#1020), a reviewer flagged that ObservableObject usage in PagerViewProps.swift requires iOS 17+, while the stated minimum deployment target is iOS 15+. This may indicate that certain SwiftUI APIs used in v8 are not fully compatible with iOS 15, causing state/event propagation to silently break on that OS version.

Workaround

Downgrade to v7.0.2:

npm install [email protected]
# or
yarn add [email protected]
Ngôn ngữ chính
TypeScript
Star
3.4k
Fork
485
Merge trung bình
2 ngày 11 giờ
Pull request đã merge (30 ngày)
26

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của callstack/react-native-pager-view

Tất cả issue của callstack/react-native-pager-view

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.