Skip to content

Root component Appear not working in first time after launch#8295

Open
markdevocht wants to merge 3 commits intomasterfrom
bugfix/Root-component-Appear-not-working-in-first-time-after-launch
Open

Root component Appear not working in first time after launch#8295
markdevocht wants to merge 3 commits intomasterfrom
bugfix/Root-component-Appear-not-working-in-first-time-after-launch

Conversation

@markdevocht
Copy link
Copy Markdown
Contributor

@markdevocht markdevocht commented May 6, 2026

Summary

Android — ReactView: defer RNN.ComponentWillAppear / RNN.ComponentDidAppear until ReactContext is available and the Fabric surface reports content (isRendered()), so JS can bindComponent before per-screen appear events. Aligns with iOS RNNReactView (pending appear until mount). Relates to #8265 (root componentDidAppear missed on first launch).

Problem

  • Instance componentDidAppear only works after Navigation.events().bindComponent(this) in mount. If native emits RNN.ComponentDidAppear before that, ComponentEventsObserver has no listeners for that componentId and the callback is dropped.
  • On Android, appear could fire from ComponentViewController visibility before the surface had mounted content; iOS already defers in RNNReactView.

What changed

  • android/src/main/java/com/reactnativenavigation/react/ReactView.java
    • Defer when getReactContext() == null or !isRendered()
    • Pending will/did, coalesced flush, bounded retries, degraded fallback if context exists but the surface never reports children
    • Clear deferred state on sendComponentStop and destroy

@markdevocht markdevocht linked an issue May 6, 2026 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Root component Appear not working in first time after launch

1 participant