From 38b635ec03d749cc0b7258ae2972ece722e0bb4a Mon Sep 17 00:00:00 2001 From: Mo Gorhom Date: Thu, 23 Sep 2021 21:01:21 +0100 Subject: [PATCH] fix: updated asigning velocity in animate worklet (#650) --- src/utilities/animate.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utilities/animate.ts b/src/utilities/animate.ts index 0cb748e7e..af4059c56 100644 --- a/src/utilities/animate.ts +++ b/src/utilities/animate.ts @@ -29,8 +29,10 @@ export const animate = ({ if (type === ANIMATION_METHOD.TIMING) { return withTiming(point, configs as Animated.WithTimingConfig, onComplete); } else { - // @ts-ignore - configs.velocity = velocity; - return withSpring(point, configs as Animated.WithSpringConfig, onComplete); + return withSpring( + point, + Object.assign({ velocity }, configs) as Animated.WithSpringConfig, + onComplete + ); } };