Skip to content

[Android] IllegalStateException: EdgeToEdgeReactViewGroup contains null child during dispatchGetDisplayList #56303

@Jianlong-Nie

Description

@Jianlong-Nie

Description

When using Fabric (New Architecture) with Edge-to-Edge enabled on Android, rapid data reordering (e.g., list item pinning/unpinning) combined with scrolling causes a reproducible crash:

IllegalStateException: EdgeToEdgeReactViewGroup contains null child at index X
when traversal in dispatchGetDisplayList, the view may have been removed.

Root Cause

EdgeToEdgeReactViewGroup.dispatchGetDisplayList() iterates children without null safety. When a child view is removed between getChildCount() and getChildAt(i) during a race condition on the UI thread, getChildAt(i) returns null, causing the crash.

The parent class ReactViewGroup already handles a similar case by catching NullPointerException in dispatchDraw (~line 987), but EdgeToEdgeReactViewGroup does not have equivalent protection in its draw path.

Steps to Reproduce

  1. Enable New Architecture (Fabric) + Edge-to-Edge on Android
  2. Use a scrollable list (e.g., FlashList) with rapid data reordering (pin/unpin items)
  3. Scroll quickly while items are being reordered
  4. Crash occurs on UI thread during view traversal

Environment

  • React Native: 0.83.2
  • Expo: 55.0.3
  • React: 19.2.0
  • Architecture: New Architecture (Fabric enabled)
  • Platform: Android with Edge-to-Edge enabled
  • Reanimated: 4.2.1
  • Gesture Handler: 2.30.0
  • FlashList: 2.3.0

Suggested Fix

Add null safety to EdgeToEdgeReactViewGroup.dispatchGetDisplayList() similar to how ReactViewGroup.dispatchDraw() already handles it — either skip null children or catch NullPointerException during traversal.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions