Skip to content

Fix Animated re-pushing event-driven props every frame while an animation changes nothing (#59835) - #59835

Open
dalves wants to merge 1 commit into
react:mainfrom
dalves:export-D129435409
Open

dalves wants to merge 1 commit into
react:mainfrom
dalves:export-D129435409

Conversation

@dalves

@dalves dalves commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

When an animation tick changes no view, NativeAnimatedNodesManager::pullAnimationMutations (shared animation backend) and the legacy onRender assume an event-driven animation has just finished. They re-run every Animated.event-driven value and push all of its props again with forceFabricCommit. That condition holds on every frame while any native animation is active but drives no view, so each frame re-applies all event-driven props, posts an empty Fabric commit to the JS thread, and mounts another UPDATE_PROPS batch even though nothing is redrawn.

This diff runs that re-sync only when an event-driven animation was actually in progress (isEventAnimationInProgress_), so it happens once after the last event, as intended.

Changelog:
[General][Fixed] - Avoid redundant native Animated prop updates while an animation changes no view.

Reviewed By: zeyap

Differential Revision: D129435409

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 6, 2026
@meta-codesync

meta-codesync Bot commented Nov 6, 2026

Copy link
Copy Markdown

@dalves has exported this pull request. If you are a Meta employee, you can view the originating Diff in D129435409.

@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Nov 6, 2026
@meta-codesync meta-codesync Bot changed the title Fix Animated re-pushing event-driven props every frame while an animation changes nothing Fix Animated re-pushing event-driven props every frame while an animation changes nothing (#59835) Nov 17, 2026
…tion changes nothing (react#59835)

Summary:

When an animation tick changes no view, `NativeAnimatedNodesManager::pullAnimationMutations` (shared animation backend) and the legacy `onRender` assume an event-driven animation has just finished. They re-run every `Animated.event`-driven value and push all of its props again with `forceFabricCommit`. That condition holds on every frame while any native animation is active but drives no view, so each frame re-applies all event-driven props, posts an empty Fabric commit to the JS thread, and mounts another `UPDATE_PROPS` batch even though nothing is redrawn.

This diff runs that re-sync only when an event-driven animation was actually in progress (`isEventAnimationInProgress_`), so it happens once after the last event, as intended.

Changelog:
[General][Fixed] - Avoid redundant native Animated prop updates while an animation changes no view.

Reviewed By: zeyap

Differential Revision: D129435409
@github-actions

Copy link
Copy Markdown

Visual regression

1 visual difference(s) at 77c43006d5ac. Visual differences need maintainer approval. Review the report, then apply visual-change-approved.

ios scroll-view/scroll-to/start: Changed, 393801 px (54.422%)

diff

Expected and Captured
Expected Captured
expected captured

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant