Zoom-out animation — element zooms out of view.
Implementation:
1import { Animated } from "react-native";23function ZoomOutView({ visible, children }) {4 const scaleAnim = useRef(new Animated.Value(1)).current;56 useEffect(() => {7 Animated.timing(scaleAnim, {8 toValue: visible ? 1 : 0,9 duration: 300,10 useNativeDriver: true,11 }).start();12 }, [visible]);1314 return (15 <Animated.View style={{16 transform: [{ scale: scaleAnim }],17 opacity: scaleAnim,18 }}>19 {children}20 </Animated.View>21 );22}