'How to create a half-sin-like Easing function in React Native?

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



Solution 1:[1]

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,
}),

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Myzel394