Flip-in — 3D flip into view.
Implementation:
1import { Animated } from "react-native";23function FlipInView({ children }) {4 const flipAnim = useRef(new Animated.Value(0)).current;56 useEffect(() => {7 Animated.spring(flipAnim, {8 toValue: 1,9 friction: 8,10 tension: 40,11 useNativeDriver: true,12 }).start();13 }, []);1415 const rotateY = flipAnim.interpolate({16 inputRange: [0, 1],17 outputRange: ["180deg", "0deg"],18 });1920 return (21 <Animated.View style={{22 opacity: flipAnim,23 transform: [{ perspective: 1000 }, { rotateY }],24 }}>25 {children}26 </Animated.View>27 );28}