Pulse animation — rhythmic pulsing effect.
Implementation:
1import { Animated } from "react-native";23function PulseView({ children }) {4 const pulseAnim = useRef(new Animated.Value(1)).current;56 useEffect(() => {7 Animated.loop(8 Animated.sequence([9 Animated.timing(pulseAnim, {10 toValue: 1.1,11 duration: 500,12 useNativeDriver: true,13 }),14 Animated.timing(pulseAnim, {15 toValue: 1,16 duration: 500,17 useNativeDriver: true,18 }),19 ])20 ).start();21 }, []);2223 return (24 <Animated.View style={{ transform: [{ scale: pulseAnim }] }}>25 {children}26 </Animated.View>27 );28}