How to do it...

  1. Let's begin by opening App.js and importing the dependencies for the App class. The Animated class will be responsible for creating the values for the animation. It provides a few components that are ready to be animated, and it also provides several methods and helpers to run smooth animations. The Easing class provides several helper methods for both calculating movements (such as linear and quadratic) and predefined animations (such as bounce, ease, and elastic). We are going to use the Dimensions class to get the current device size so that we know where to place the element in the initialization of the animation:
import React, { Component } from 'react';import {  Animated,  Easing,  Dimensions,  StyleSheet,  View,} from ...

Get React Native Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.