diff --git a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m index 5c19386cd93650..b4aec0c33288fe 100644 --- a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m +++ b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m @@ -70,10 +70,10 @@ - (void)startAnimation - (void)stopAnimation { - _valueNode = nil; if (_callback) { - _callback(@[ @{@"finished" : @(_animationHasFinished)} ]); + _callback(@[ @{@"finished" : @(_animationHasFinished), @"value" : @(_valueNode.value)} ]); } + _valueNode = nil; } - (void)stepAnimationWithTime:(NSTimeInterval)currentTime diff --git a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m index d2bf4cd618b24c..1de5cb13eb8ffa 100644 --- a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m +++ b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m @@ -76,10 +76,10 @@ - (void)startAnimation - (void)stopAnimation { - _valueNode = nil; if (_callback) { - _callback(@[ @{@"finished" : @(_animationHasFinished)} ]); + _callback(@[ @{@"finished" : @(_animationHasFinished), @"value" : @(_valueNode.value)} ]); } + _valueNode = nil; } - (void)stepAnimationWithTime:(NSTimeInterval)currentTime diff --git a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m index 232916017607de..640107df09c287 100644 --- a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m +++ b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m @@ -96,10 +96,10 @@ - (void)startAnimation - (void)stopAnimation { - _valueNode = nil; if (_callback) { - _callback(@[ @{@"finished" : @(_animationHasFinished)} ]); + _callback(@[ @{@"finished" : @(_animationHasFinished), @"value" : @(_valueNode.value)} ]); } + _valueNode = nil; } - (void)stepAnimationWithTime:(NSTimeInterval)currentTime diff --git a/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m b/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m index 09682c19e9b433..7e0c3fcefdddf6 100644 --- a/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m +++ b/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m @@ -486,7 +486,8 @@ - (void)testAnimationCallbackFinish RCTResponseSenderBlock endCallback = ^(NSArray *response) { endCallbackCalls++; - XCTAssertEqualObjects(response, @[ @{@"finished" : @YES} ]); + NSArray *expected = @[ @{@"finished" : @YES, @"value" : @1} ]; + XCTAssertEqualObjects(response, expected); }; [_nodesManager startAnimatingNode:@1 @@ -714,7 +715,8 @@ - (void)testHandleStoppingAnimation RCTResponseSenderBlock endCallback = ^(NSArray *response) { endCallbackCalled = YES; - XCTAssertEqualObjects(response, @[ @{@"finished" : @NO} ]); + XCTAssertEqual(response.count, 1); + XCTAssertEqualObjects(response[0][@"finished"], @NO); }; [_nodesManager startAnimatingNode:@404