A framework for building native applications using React
Make removeClippedSubviews toggle-resilient (#56211)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56211 The `removeClippedSubviews` prop toggle path in `RCTViewComponentView` did not handle being turned off: children that were clipped (removed from superview) remained invisible, and `_reactSubviews` became stale. This diff: - Adds `_updateRemoveClippedSubviewsState` helper that ensures consistent state when toggling. On toggle-off, re-mounts all children from `_reactSubviews` in the correct order and clears the tracking array. - Makes the unmount path resilient by cleaning up `_reactSubviews` even when `removeClippedSubviews` is off. - Splits the unmount assert into two distinct messages: "not mounted" vs "mounted inside a different view". - Adds unit tests covering toggle-off re-mounting, ordering, cleanup, and unmount-after-toggle scenarios. Changelog: [iOS][Fixed] Fixes crash when changing the value of `removeClippedSubviews` Reviewed By: sbuggay Differential Revision: D97971845 fbshipit-source-id: c5d0a99e632a23613cc5e05bcf00c2985c30d5b4
P
Pieter De Baets committed
91e3f773b7e571a503b57e09a1cb8a44ff26cd1e
Parent: bfb6870
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com>
on 3/27/2026, 7:59:26 AM