Latest in React Native
Home → React Native
Animated.loop in React Native doesn't make the animation loop on web
It took me a while of testing, but whatever I tried resulted in one animation loop when compiling a React Native component for the Web. Turns out, there's one parameter that was causing it.
Whenever you create a looped animation with
Whenever you create a looped animation with
Animated.loop()
and Animated.timing()
, remember about the parameter useNativeDriver
in Animated.timing
: it has to be false
for web, as there's no native driver per sē. For example:import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons'; const AnimatedIconComponent = Animated.createAnimatedComponent(MaterialCommunityIcons);...