react-native-macos/Libraries/Animated/__tests__
Eric Rozell fe53cae954 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
2021-12-10 08:07:38 -08:00
..
Animated-test.js RN: Resolve Outstanding ESLint Warnings 2021-11-09 21:46:21 -08:00
AnimatedMock-test.js RN: Remove `react-animated` Legacy Package 2020-08-25 14:15:35 -07:00
AnimatedNative-test.js Deduct offset from `getValue` result when detaching 2021-12-10 08:07:38 -08:00
Easing-test.js JS: Format with Prettier v2.4.1 [3/n] 2021-11-02 22:14:16 -07:00
Interpolation-test.js RN: Remove `react-animated` Legacy Package 2020-08-25 14:15:35 -07:00
TimingAnimation-test.js RN: Remove `react-animated` Legacy Package 2020-08-25 14:15:35 -07:00
bezier-test.js JS: Format with Prettier v2.4.1 [3/n] 2021-11-02 22:14:16 -07:00
createAnimatedComponentInjection-test.js Animated: Setup Experiment Injection 2021-06-02 22:36:13 -07:00