Search code examples
react-nativeanimationexporeact-native-reanimatedreact-native-reanimated-v2

React-native animation lagging on android


I'm using the Reanimated library(2.2.0), and I have a fairly simple animation to expand a Animated.View , that I call when pressing a TouchableOpacity:

    height.value = withTiming(calculatedHeight, {
      duration: 300,
      easing: Easing.inOut(Easing.ease),
    });

On IOS is running very nice on 60fps, but on some Android phones like Samsung S20,S21 Ultra, the animation is lagging a lot. I tried it on an older Samsung(A5) and on it is running fine again. Any suggestions are appreciated.


Solution

  • Animate the Y scale instead of the height. left top width height are slow