O'Reilly logo

Mastering React Native by Jacob Friedmann, Eric Masiello

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding Animated

LayoutAnimation is great for transitioning views between states using simple animation logic. However, LayoutAnimation is limited in that it doesn't allow you to sequence more complex animations or potentially tie an animation to a user gesture. This is where the Animated API fills the gap. Internally, the Animated API leverages requestAnimationFrame to synchronize animations to 60 frames per second. It then updates the state via setNativeProps as a means of avoiding React's diffing algorithm, thus keeping the animations performant and smooth.

In order to use the Animated API, you need two things. First, you'll need an Animated.* component--Animated.Image, Animated.View, or Animated.Text. These special Animated.* components ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required