react-native-macos/Libraries/Animated
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
..
__tests__ Deduct offset from `getValue` result when detaching 2021-12-10 08:07:38 -08:00
animations pre-suppress this typing errors ahead of 154 2021-06-11 14:31:41 -07:00
components RN: Disable `collapsable` for Animated Components 2021-09-29 17:22:21 -07:00
nodes Deduct offset from `getValue` result when detaching 2021-12-10 08:07:38 -08:00
Animated.js Remove "use strict" directive from ES Modules 2021-02-02 11:12:56 -08:00
AnimatedEvent.js Fix validation of AnimatedEvent with AnimatedValueXY 2021-09-09 04:31:58 -07:00
AnimatedImplementation.js Fix reference URLs in Animated 2021-11-17 20:35:19 -08:00
AnimatedMock.js JS: Format with Prettier v2.4.1 [3/n] 2021-11-02 22:14:16 -07:00
AnimatedWeb.js Update FlowFixMes to use error codes in react-native-github 2021-03-31 18:21:47 -07:00
Easing.js Fixes documantion for back Easing 2021-10-18 13:35:11 -07:00
NativeAnimatedHelper.js JS: Format with Prettier v2.4.1 [3/n] 2021-11-02 22:14:16 -07:00
NativeAnimatedModule.js Remove "use strict" directive from ES Modules 2021-02-02 11:12:56 -08:00
NativeAnimatedTurboModule.js Remove "use strict" directive from ES Modules 2021-02-02 11:12:56 -08:00
SpringConfig.js Add LTI annotations to xplat/js 2021-11-10 15:40:15 -08:00
bezier.js Add LTI annotations to xplat/js 2021-11-10 15:40:15 -08:00
createAnimatedComponent.js Add LTI annotations to xplat/js 2021-11-10 15:40:15 -08:00
createAnimatedComponentInjection.js Animated: Setup Experiment Injection 2021-06-02 22:36:13 -07:00
createAnimatedComponent_EXPERIMENTAL.js Add passthroughAnimatedPropsExplicitValues to modern createAnimatedComponent 2021-07-08 09:29:38 -07:00
useAnimatedProps.js Add animation queue to modern createAnimatedComponent 2021-07-08 09:29:38 -07:00