BounceIn — element bounces into view.
Implementation:
1import { Animated } from "react-native";23function BounceInView({ children }) {4 const bounceAnim = useRef(new Animated.Value(0)).current;56 useEffect(() => {7 Animated.sequence([8 Animated.spring(bounceAnim, {9 toValue: 1.2,10 friction: 1,11 tension: 100,12 useNativeDriver: true,13 }),14 Animated.spring(bounceAnim, {15 toValue: 1,16 friction: 3,17 useNativeDriver: true,18 }),19 ]).start();20 }, []);2122 return (23 <Animated.View style={{24 transform: [25 { scale: bounceAnim },26 { translateY: bounceAnim.interpolate({27 inputRange: [0, 1],28 outputRange: [50, 0],29 }) },30 ],31 }}>32 {children}33 </Animated.View>34 );35}