Root component Appear not working in first time after launch

オープン
#8,265 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

  • #8295 @markdevocht による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, react-native
領域
mobile

調査の方向性

まず、オープンな pull request #8295 と、この issue で説明されている bindComponent フローを確認します。初回起動時に、AppState.addEventListener('change', ...) と handleAppStateChange が root screen の componentDidAppear につながる流れを追跡します。初回起動時に root component がマウントされた後、componentDidAppear が確実に通知され、関連する動作がプロジェクトのテストでカバーされていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

🏚 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

主要言語
MDX
スター
13.2k
フォーク
2.6k
平均マージ
2日 10時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

wix/react-native-navigation のほかの issue

wix/react-native-navigation の issue をすべて見る

似ている issue

Mobile Dev の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。