0

Is there some way to create a function like Easing.HalfSin in React Native?

Myzel394
  • 1,155
  • 3
  • 16
  • 40

1 Answers1

0

Based on this answer we can create an approximate function using bezier:

const EasingHalfSin = Easing.bezier(0.364212423249, 0, 0.635787576751, 1);

and then use it like any other easing function:

Animated.timing(position, {
    toValue: 150,
    duration: 1000,
    useNativeDriver: true,
    easing: EasingHalfSin,
}),
Myzel394
  • 1,155
  • 3
  • 16
  • 40