Repository navigation
Conversation
|
Hi @theeket! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary:
Related to #59166. This change addresses the unmount comparison; it does not reset container state during recycling.
Unmounting a zero-sized recycled
Viewcan fail withAttempt to unmount a view which is mounted inside a different view, even when the exception reports the parent's own tag as the existing parent.A previous owner can leave the native view with a clipping container, for example when using
overflow: 'hidden'with an outline. Fabric can mount descendants before applying the recycled parent's new props. If those props no longer require the container and the view has zero bounds, layer invalidation returns without migrating the children back.currentContainerViewperforms that migration lazily. The unmount assertion compareschildComponentView.superview == self.currentContainerView, so evaluation can read the child's old superview before the getter moves it. By the time the exception message is formatted, the child can already belong to the expected parent.Resolve the container in a separate statement before reading
superviewin the assertions. The reconciliation also runs when assertions are disabled. Existing ownership and index checks remain unchanged.Changelog:
[IOS] [FIXED] - Reconcile recycled view containers before checking child ownership during Fabric unmount.
Test Plan:
Added native regression tests for:
The lifecycle sequence above is constructed directly with
RCTViewComponentView; it is not an end-to-end JavaScript/Fabric reproduction. Its assertion behavior can depend on operand evaluation order before the fix.The
RCTViewComponentViewUnmountTests.mmpassed.Real application tested on
react-native0.88.1 with iOS 27.2 device, Xcode 27.1.