Call reactSetFrame
on affected layouts bottom-up
#41608
Closed
+3
−3
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.
Summary:
Fixes #41545
RN lays out the descendants of a root view using Yoga, then recurses to make a list of ShadowNodes which have new layout updates.
iOS Paper uses that list directly for ordering of calling
reactSetFrame
which informs UIViews of their dimensions.As part of aligning Paper to Fabric's model of top-down onLayout events, 3168055 changed the ordering of the list from being pseudo-random, to always top-down.
After the change, we can deterministically see a case of infinite recursion where:
safeAreaInsetsDidChange
ofRCTSafeAreaView
, which doesn't have a frame yetRCTSafeAreaView
triggers sync relayout of root viewAssigning frames bottom up (and is also what Android Paper does) ensures we lay out the RootView last, which avoids the issue, while keeping a deterministic order.
Changelog:
[iOS][Fixed] - Call
reactSetFrame
on affected layouts bottom-upDifferential Revision: D51534209