Root component Appear not working in first time after launch

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

Chưa có ai nhận issue này.

  • #8295 của @markdevocht — đã đóng, không merge

Đá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
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, react-native
Lĩnh vực
mobile

Hướng nghiên cứu

Bắt đầu bằng cách xem xét pull request đang mở #8295 và luồng bindComponent được mô tả trong issue này. Theo dõi cách AppState.addEventListener('change', ...) và handleAppStateChange dẫn đến componentDidAppear cho một màn hình root trong lần khởi chạy đầu tiên. Được xem là hoàn tất khi componentDidAppear được gửi một cách đáng tin cậy sau khi component root được mount trong lần khởi chạy ban đầu, với hành vi liên quan được các bài kiểm thử của dự án bao phủ.

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

Mô tả

🏚 stale platform: Android type: accepted/bug
What happened?

Root component Appear not working in first time after launch

Root cause: AppState.addEventListener('change', ...) only fires on changes — not the initial state. On first launch the app is already 'active', so no change event fires. handleAppStateChange (which calls componentDidAppear()) never runs.

RNN's bindComponent should handle this, but for root screens RNN sometimes fires componentDidAppear before the component is fully mounted, causing it to be missed.

What was the expected behaviour?

No response

Was it tested on latest react-native-navigation?
  • I have tested this issue on the latest react-native-navigation release and it still reproduces.
Help us reproduce this issue!

Root cause: AppState.addEventListener('change', ...) only fires on changes — not the initial state. On first launch the app is already 'active', so no change event fires. handleAppStateChange (which calls componentDidAppear()) never runs.

RNN's bindComponent should handle this, but for root screens RNN sometimes fires componentDidAppear before the component is fully mounted, causing it to be missed.

In what environment did this happen?

React Native Navigation version:
React Native version: 0.84
Has Fabric (React Native's new rendering system) enabled: (yes/no) yes
Node version: 24
Device model: sumsung : SM M325F
Android version: 14

Ngôn ngữ chính
MDX
Star
13.2k
Fork
2.6k
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
6

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 wix/react-native-navigation

Tất cả issue của wix/react-native-navigation

Issue tương tự

Thêm issue về Mobile Dev

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.