From cc816fbd8239311972380353dbd3fbc8f65ad6ae Mon Sep 17 00:00:00 2001 From: Joel Arvidsson Date: Tue, 5 Jul 2016 10:58:17 -0700 Subject: [PATCH] Harmonize native animation callback args with JS Summary: `Animated.parallel` among other functions expects the `start(callback)` function to be invoked with an `endState` object. Currently natively driven animations call the handler with `null`, this PR changes that to `{ finished: true }`. **Test plan** This should not throw any errors: ```js Animated.parallel([ Animated.timing( new Animated.Value(0), { toValue: 1, useNativeDriver: true } ), Animated.timing( new Animated.Value(0), { toValue: 1, useNativeDriver: true } ) ]).start(); ``` Closes https://github.com/facebook/react-native/pull/8567 Differential Revision: D3517291 Pulled By: javache fbshipit-source-id: 0056a5b4261546b061451c0b1b249718739086bc --- Libraries/NativeAnimation/Nodes/RCTAnimationDriverNode.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/NativeAnimation/Nodes/RCTAnimationDriverNode.m b/Libraries/NativeAnimation/Nodes/RCTAnimationDriverNode.m index cdd8d491d..eb0a8d802 100644 --- a/Libraries/NativeAnimation/Nodes/RCTAnimationDriverNode.m +++ b/Libraries/NativeAnimation/Nodes/RCTAnimationDriverNode.m @@ -68,7 +68,9 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) [self stopAnimation]; _valueNode = nil; if (_callback) { - _callback(@[(id)kCFNull]); + _callback(@[@{ + @"finished": @(_animationHasFinished) + }]); } }