Using the internal Animated API of React Native
React Native comes with a built-in Animated API. This API is quite powerful, and you can achieve a lot of different animation goals with it. In this section, we will have a brief look at how it works and what advantages and limitations the internal Animated API has.
For a complete tutorial, please have a look at the official documentation at bit.ly/prn-animated-api.
To understand how the Animated API works, let’s start with a simple example.
Starting with a simple example
The following code implements a simple fade-in animation, which makes a view appear over the duration of 2 seconds:
import React, { useRef } from "react"; import { Animated, View, Button } from "react-native"; const App = () => { const opacityValue = useRef(new Animated.Value(0)). current; const showView = () => { Animated.timing(opacityValue...