Book Image

React Native - Building Mobile Apps with JavaScript

By : Vladimir Novick
Book Image

React Native - Building Mobile Apps with JavaScript

By: Vladimir Novick

Overview of this book

<p>The emergence of React Native has made creating mobile apps in JavaScript easier for developers. This book introduces you to the React Native framework and the mobile apps development process. It starts with how React Native fits into the world of hybrid apps, and why it’s a popular framework. You’ll learn how React Native works under the hood--compiling JavaScript to Native code to bridge JavaScript and native apps. Also, you’ll learn how to write React Native components and use the ReactJS way of structuring your app. Understand how to use the industry standard Redux architecture as well as MobX--a newly emerging approach for state management--making your apps more robust and scalable.</p> <p>The mobile native world can be intimidating, with lots of platform-specific APIs. In this book, you’ll learn about the most important APIs with help of the real-world examples. You’ll also learn about the community packages that can help speed up your development. The book explains how to use these packages with JavaScript code, include native modules in your application, and write the modules yourself. Throughout the book, you will see examples of WhatsApp, Instagram, and YouTube apps and learn how to recreate them. You’ll also learn debugging and testing techniques, authentication, dealing with real data, and much more.</p> <p>At the end we will walk through design to production process of Twitter app clone and will explain application release process to App Store and Play Store</p>
Table of Contents (13 chapters)

Animated functions

Okay, so we've defined our animations in state and created Animated.View with corresponding styles for each circle. Now, it's time to start animation. In order to do so, we will use Animated functions.

Let's start our animations on componentDidMount():

componentDidMount(){
const { timing } = Animated;
const { scaleAnim, fadeAnim, slideAnim } = this.state;
timing(
fadeAnim, { toValue: 1 }
).start();
timing(
slideAnim, { toValue: 0 }
).start();
timing(
scaleAnim, { toValue: 1 }
).start();
}

Here, we will use the Animated.timing function. This function, as other Animated functions--which we will cover in a bit--is used to configure and compose our animations if needed. Animated.timing can be configured with a duration parameter and easing parameter. Default easing is easeInOut, but can be configured using Easing functions exported...