Bounce animation — element bounces into view.
Implementation:
1import { Animated } from "react-native";23function BounceView({ children }) {4 const bounceAnim = useRef(new Animated.Value(0)).current;56 useEffect(() => {7 Animated.spring(bounceAnim, {8 toValue: 1,9 friction: 1,10 tension: 100,11 useNativeDriver: true,12 }).start();13 }, []);1415 const scale = bounceAnim.interpolate({16 inputRange: [0, 0.5, 0.7, 0.8, 0.9, 1],17 outputRange: [0, 1.2, 0.9, 1.1, 0.95, 1],18 });1920 return (21 <Animated.View style={{ transform: [{ scale }] }}>22 {children}23 </Animated.View>24 );25}