wix / wix/react-native-navigation
Root component Appear not working in first time after launch
- Dominant language
- MDX
- Stars
- 13.2k
- Forks
- 2.6k
- Avg merge
- 6d 2h
- Merged PRs (30d)
- 1
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing open pull request #8295 and the bindComponent flow described in this issue. Trace how AppState.addEventListener('change', ...) and handleAppStateChange lead to componentDidAppear for a root screen on first launch. Done means componentDidAppear is reliably delivered after the root component is mounted on initial launch, with the relevant behavior covered by the project's tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100