Using React Native Reanimated
In the React Native world, we have a lot of libraries and approaches to animate our components, including the built-in Animated API. But in this chapter, I would like to opt for a library called React Native Reanimated and compare it with the Animated API to learn why it is the best choice.
Animated API
The Animated API is the most common tool used to animate components in React Native. It has a set of methods that help you create an animation object, control its state, and process it. The main benefit is that it can be used with any component, not just animated components such as View or Text.
But, at the same time, this API runs its animation driver on the JavaScript thread by default, though the useNativeDriver option can offload certain properties like opacity and transform to the native thread. Updates are scheduled asynchronously and may be delayed by at least one frame, lasting approximately 16 ms. Sometimes, the delay may last even longer if the JavaScript...