Width/height animation — animate dimensions.
Basic dimension animation:
1import { Animated } from "react-native";23const heightAnim = useRef(new Animated.Value(0)).current;4const widthAnim = useRef(new Animated.Value(100)).current;56Animated.parallel([7 Animated.timing(heightAnim, {8 toValue: 200,9 duration: 500,10 useNativeDriver: false, // Dimensions need JS driver11 }),12 Animated.timing(widthAnim, {13 toValue: 300,14 duration: 500,15 useNativeDriver: false,16 }),17]).start();1819<Animated.View style={{20 width: widthAnim,21 height: heightAnim,22 backgroundColor: "#333",23}}>24 <Text>Resizing</Text>25</Animated.View>
Important notes:
useNativeDriver: false.