Latest in React Native

HomeReact 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 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);...

About Code with Node.js

This is a personal blog and reference point of a Node.js developer.

I write and explain how different Node and JavaScript aspects work, as well as research popular and cool packages, and of course fail time to time.