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 bounceease, 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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.