Repository navigation
Step time-based animations only on frames with the shared animated backend (#59565) - #59565
Merged
Merged
Conversation
|
@markv has exported this pull request. If you are a Meta employee, you can view the originating Diff in D127496079. |
markv
pushed a commit
to markv/react-native
that referenced
this pull request
Oct 28, 2026
…ckend (react#59565) Summary: Pull Request resolved: react#59565 Fixes native-driven animations stepping backward for a frame when the shared animated backend is on and a native event update (e.g. an `Animated.event` `onScroll`) runs between frames. Without the shared backend this does not happen. With the shared backend, an event update also steps every active timing, spring and decay animation, at the time of the update. Frames step them at the platform frame time (on Android, the Choreographer vsync time), which is often earlier: 1. An event update steps an animation at time T. 2. The next frame steps it at T - 8..25 ms. 3. The animation moves backward for that frame; a timing animation started by the event overshoots past its start value. Event updates now only propagate the event values, and time-based animations step only on frames. This aligns the shared backend with the implementations it replaces: the Kotlin `NativeAnimatedNodesManager` updates nodes on events without stepping animations, and the C++ path without the shared backend steps everything on one clock. As on Kotlin, a timing animation whose `toValue` tracks an event-driven value restarts on each event and advances only on frames between events. Changelog: [General][Fixed] - Fix native-driven animations stepping backward when a native event update runs between frames with the shared animated backend Reviewed By: zeyap Differential Revision: D127496079
markv
force-pushed
the
export-D127496079
branch
from
October 28, 2026 04:19
177c051 to
33704e8
Compare
…ckend (react#59565) Summary: Fixes native-driven animations stepping backward for a frame when the shared animated backend is on and a native event update (e.g. an `Animated.event` `onScroll`) runs between frames. Without the shared backend this does not happen. With the shared backend, an event update also steps every active timing, spring and decay animation, at the time of the update. Frames step them at the platform frame time (on Android, the Choreographer vsync time), which is often earlier: 1. An event update steps an animation at time T. 2. The next frame steps it at T - 8..25 ms. 3. The animation moves backward for that frame; a timing animation started by the event overshoots past its start value. Event updates now only propagate the event values, and time-based animations step only on frames. This aligns the shared backend with the implementations it replaces: the Kotlin `NativeAnimatedNodesManager` updates nodes on events without stepping animations, and the C++ path without the shared backend steps everything on one clock. As on Kotlin, a timing animation whose `toValue` tracks an event-driven value restarts on each event and advances only on frames between events. Changelog: [General][Fixed] - Fix native-driven animations stepping backward when a native event update runs between frames with the shared animated backend Reviewed By: zeyap Differential Revision: D127496079
markv
force-pushed
the
export-D127496079
branch
from
October 28, 2026 18:34
33704e8 to
cf84371
Compare
Collaborator
|
This pull request was successfully merged by @markv in dee5bb5 When will my fix make it into a release? | How to file a pick request? |
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.
Summary:
Fixes native-driven animations stepping backward for a frame when the shared animated backend is on and a native event update (e.g. an
Animated.eventonScroll) runs between frames. Without the shared backend this does not happen.With the shared backend, an event update also steps every active timing, spring and decay animation, at the time of the update. Frames step them at the platform frame time (on Android, the Choreographer vsync time), which is often earlier:
Event updates now only propagate the event values, and time-based animations step only on frames. This aligns the shared backend with the implementations it replaces: the Kotlin
NativeAnimatedNodesManagerupdates nodes on events without stepping animations, and the C++ path without the shared backend steps everything on one clock. As on Kotlin, a timing animation whosetoValuetracks an event-driven value restarts on each event and advances only on frames between events.Changelog: [General][Fixed] - Fix native-driven animations stepping backward when a native event update runs between frames with the shared animated backend
Reviewed By: zeyap
Differential Revision: D127496079