Are there any performance impact when using animated components i.e Animated.View vs using regular component i.e View in react native if there are 0 animations involved?
code example:
<View>
<Text>asd</Text>
</View>
Vs
<Animated.View>
<Text>asd</Text>
</Animated.View>
I have never seen people mention any performance impact when using Animated components but then again if there are none, why hasn't React developers make all components Animated by default.
Whenever we have a component in which we update the Native View frequently using inline styles, using Animated.View along with the optional native driver saves a lot of re-renders.
When we use Animated.View, the following process takes place behind the hood:
requestAnimationFrame is fired in JSAs we can see, Animated.View styles don't trigger a re-render of React Native Components, that is why their use should be preferred over <View /> in such situations to avoid wasted renders.
Ref: [https://tech.unacademy.com/10-ways-to-avoid-wasted-renders-in-react-native-app-part-2/][1]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With