Files
Zeya Peng dae2f606c7 Course correct props at SurfaceMountingManager.updateProps() (#53589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53589

## Changelog:

[Android] [Changed] - [c++ animated] Course correct props at SurfaceMountingManager.updateProps()

Sometimes a React update will try to commit to the same view that native animated modified before via direct manipulation, and after the update host view will use the prop value currently in Fabric. In `AnimatedMountingOverrideDelegate` there's logic to course correct at ShadowTree mount, but if this update is from JS thread, it takes some time to reach mounting layer, at the same time UI thread can still be doing more direct animation updates, and once the corrected change gets there it's already stale.

In this diff I added mechanism to keep track of direct manipulation props (or "synchronous mount props" to match the naming of java function `synchronouslyUpdateView...`) and use it to correct what reaches host view. `SurfaceMountingManager.updateProps()` is called by both regular mount and direct manipulation and it's always called on UI thread, so it could be a good candidate to synchronize these 2 scenarios

Reviewed By: sammy-SC

Differential Revision: D81611823

fbshipit-source-id: 638a59bcd94b3d7e8bab68defd472b2b482dc92f
2025-09-05 09:18:50 -07:00
..