-
Notifications
You must be signed in to change notification settings - Fork 25.1k
[Android] IllegalStateException: EdgeToEdgeReactViewGroup contains null child during dispatchGetDisplayList #56303
Description
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
- Enable New Architecture (Fabric) + Edge-to-Edge on Android
- Use a scrollable list (e.g., FlashList) with rapid data reordering (pin/unpin items)
- Scroll quickly while items are being reordered
- 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
- Upstream report in FlashList: FlashList Android crash with Fabric + Edge-to-Edge during rapid data reordering Shopify/flash-list#2086