diff --git a/Libraries/Animated/__tests__/Animated-test.js b/Libraries/Animated/__tests__/Animated-test.js index 014a6186828546..7a91b85ece58d8 100644 --- a/Libraries/Animated/__tests__/Animated-test.js +++ b/Libraries/Animated/__tests__/Animated-test.js @@ -782,6 +782,19 @@ describe('Animated tests', () => { value1.setValue(1492); expect(value2.__getValue()).toBe(7); }); + + it('should start tracking immediately on animation start', () => { + const value1 = new Animated.Value(42); + const value2 = new Animated.Value(0); + Animated.timing(value2, { + toValue: value1, + duration: 0, + useNativeDriver: false, + }).start(); + expect(value2.__getValue()).toBe(42); + value1.setValue(7); + expect(value2.__getValue()).toBe(7); + }); }); describe('Animated Vectors', () => { diff --git a/Libraries/Animated/nodes/AnimatedValue.js b/Libraries/Animated/nodes/AnimatedValue.js index 7cfc7b940a3f54..c0e8f7341cc4a7 100644 --- a/Libraries/Animated/nodes/AnimatedValue.js +++ b/Libraries/Animated/nodes/AnimatedValue.js @@ -270,6 +270,8 @@ class AnimatedValue extends AnimatedWithChildren { track(tracking: AnimatedTracking): void { this.stopTracking(); this._tracking = tracking; + // Make sure that the tracking animation starts executing + this._tracking && this._tracking.update(); } _updateValue(value: number, flush: boolean): void {