mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 03:50:11 +08:00
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
This commit is contained in:
committed by
Facebook Github Bot 2
parent
0d58314fa6
commit
cc816fbd82
@@ -68,7 +68,9 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
[self stopAnimation];
|
||||
_valueNode = nil;
|
||||
if (_callback) {
|
||||
_callback(@[(id)kCFNull]);
|
||||
_callback(@[@{
|
||||
@"finished": @(_animationHasFinished)
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user