List item animation — animate items entering the list.
Staggered animation:
1import { Animated, FlatList, View, Text, StyleSheet } from "react-native";23function AnimatedList({ data }) {4 const animatedValues = useRef(5 data.map(() => new Animated.Value(0))6 ).current;78 useEffect(() => {9 Animated.stagger(10 100,11 animatedValues.map((anim) =>12 Animated.timing(anim, {13 toValue: 1,14 duration: 500,15 useNativeDriver: true,16 })17 )18 ).start();19 }, []);2021 return (22 <FlatList23 data={data}24 renderItem={({ item, index }) => (25 <Animated.View26 style={{27 opacity: animatedValues[index],28 transform: [{29 translateX: animatedValues[index].interpolate({30 inputRange: [0, 1],31 outputRange: [50, 0],32 }),33 }],34 }}35 >36 <View style={styles.item}>37 <Text>{item.name}</Text>38 </View>39 </Animated.View>40 )}41 keyExtractor={(item) => item.id}42 />43 );44}