Skip to content

fix: less often remount on scrollview#1

Open
WoLewicki wants to merge 1 commit into
0.81.4-discordfrom
wolewicki/scrollview-mount-performance
Open

fix: less often remount on scrollview#1
WoLewicki wants to merge 1 commit into
0.81.4-discordfrom
wolewicki/scrollview-mount-performance

Conversation

@WoLewicki

@WoLewicki WoLewicki commented Jun 17, 2026

Copy link
Copy Markdown

On the New Architecture (Fabric), Reanimated commits the shadow tree ~once per animation frame, and each mount transaction unconditionally called _remountChildren, re-clipping the entire descendant subtree even when nothing scrolled or changed layout.

Guard _remountChildren with RCTMountingTransactionAffectsClipping, which returns YES only when the transaction can change clipping: an Insert/Remove mutation, an Update with changed layoutMetrics, or an Update toggling removeClippedSubviews. maintainVisibleContentPosition is unaffected since _adjustForMaintainVisibleContentPosition still runs on every mount.

Moves the change from the React-RCTFabric local pod patch (discord/discord#292855) directly into the RN fork.

On the New Architecture (Fabric), Reanimated commits the shadow tree
~once per animation frame, and each mount transaction unconditionally
called _remountChildren, re-clipping the entire descendant subtree even
when nothing scrolled or changed layout.

Guard _remountChildren with RCTMountingTransactionAffectsClipping, which
returns YES only when the transaction can change clipping: an
Insert/Remove mutation, an Update with changed layoutMetrics, or an
Update toggling removeClippedSubviews. maintainVisibleContentPosition is
unaffected since _adjustForMaintainVisibleContentPosition still runs on
every mount.

Moves the change from the React-RCTFabric local pod patch
(discord/discord#292855) directly into the RN fork.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant