Using Lottie animations in React Native
Lottie is a completely different approach to animations in app and web development. It allows you to render and control prebuilt vector animations. The following figure shows the process of how a Lottie animation is created and played:
Figure 6.3 – The workflow when animating with Lottie
Essentially, Lottie consists of a player, which in the case of React Native is the lottie-react-native
library. This library expects a JSON file of a Lottie animation. This file is created with Adobe After Effects (a professional animation software) and exported to JSON with the Bodymovin plugin.
This process completely changes the way we work with animations in apps. The developer is no longer responsible for creating the animations; they only have to include the JSON file. This can save a huge amount of time when working with very complex animations.
All of this becomes clearer when looking at a simple Lottie animation...