Skip to content

Commit

Permalink
fix: updated asigning velocity in animate worklet (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Sep 23, 2021
1 parent 15225ae commit 38b635e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utilities/animate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
};

0 comments on commit 38b635e

Please sign in to comment.