Repository navigation
fix(react-native/ios): attach a recycled NativeScriptUIView's handle when it matches its last one - #80
Merged
Conversation
…when it matches its last one Fabric keeps _props across prepareForRecycle while the container is cleared, so diffing against _props skipped setNativeViewHandle when a recycled host was mounted with the handle it last showed, leaving it empty. Diff against the oldProps argument instead, which is null on a fresh mount.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
ammarahm-ed
approved these changes
Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #77 (item 1 of the "NativeScript bugs" list in ng-native/ng-native#931).
Summary
A recycled
NativeScriptUIViewstayed empty when it was remounted with the handle it last showed. Fabric keeps_propsacrossprepareForRecycle, while the container is cleared, so diffing against_propssaw no handle change and never re-attached the view._propsitself is left alone, because RN's ownprepareForRecyclediffs layer state against it.Evidence
iOS 26.5 simulator, Debug, RN 0.86.3 / Expo. The same commit was tested in #77, cherry-picked here unchanged.
NativeScriptUIViewwith the same handle, and the red view does not come back (superviewis nil).superviewis set.Merge Danger
Door: two-way
Blast Radius: iOS
NativeScriptUIViewonlyA fresh mount passes
oldProps == nullptr, which now maps to the default props, so first mounts attach exactly as before.