Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deduct offset from
getValue
result when detaching
Summary: The NativeAnimated `getValue` API returns `value + offset`: Android: iOS: https://github.com/facebook/react-native/blob/main/Libraries/NativeAnimation/Nodes/RCTValueAnimatedNode.m#L44 Android: https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/animated/ValueAnimatedNode.java#L36 When we store the value after detaching the NativeAnimated node, it stores the result of the NativeAnimated `getValue` call to the `_value` property, so if we call `__getValue` at some later point on the `AnimatedValue`, we will count the offset twice. This change deducts the offset value from the result returned from `getValue` when storing the latest value. Changelog: [General][Fixed] - AnimatedValue.__detach should store getValue result with offset deducted Reviewed By: yungsters Differential Revision: D32987003 fbshipit-source-id: 488d1fe512f886c7a9de1e5a4de8f19441ebd81e
- Loading branch information