Introducing LayoutAnimation and Animated
Before we delve too deeply into either animation API, let's first set out why you would use one API as opposed to the other. LayoutAnimation
has a far simpler API than Animated
. As a result, it's less configurable. LayoutAnimation
will animate a component upon a render cycle, such as when you call setState
. Animated
allows you, at a much more granular level, to configure how an animation or sequences of animations is executed. Additionally, the Animated
API can tie animations to user gestures, allowing users, for example, to drag an element across the screen.