Light-speed-in — fast light effect.
Implementation:
1import { Animated } from "react-native";23function LightSpeedInView({ children }) {4 const translateX = useRef(new Animated.Value(200)).current;5 const opacity = useRef(new Animated.Value(0)).current;6 const skewX = useRef(new Animated.Value("-15deg")).current;78 useEffect(() => {9 Animated.parallel([10 Animated.spring(translateX, {11 toValue: 0,12 friction: 8,13 useNativeDriver: true,14 }),15 Animated.timing(opacity, {16 toValue: 1,17 duration: 500,18 useNativeDriver: true,19 }),20 Animated.timing(skewX, {21 toValue: "0deg",22 duration: 500,23 useNativeDriver: true,24 }),25 ]).start();26 }, []);2728 return (29 <Animated.View style={{30 opacity,31 transform: [32 { translateX },33 { skewX },34 ],35 }}>36 {children}37 </Animated.View>38 );39}