O'Reilly logo

React Native Cookbook by Crysfel Villa, Stan Bershadskiy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading animation

In this recipe, we will continue working with the LayoutAnimation class. Here we will create a button when the user presses the button we will show a loading indicator and animate the styles.

Getting ready

Before we start, we need to create an empty app. We are going to call it ButtonLoading, feel free to use any other name, just make sure to use the correct name when registering the bootstrap component.

In addition, we need to create the src/MainApp.js and src/Button/index.js files.

How to do it...

  1. Open the index.ios.js file, remove the current code and add the following. Make sure to use the name of the app, in this case, ButtonLoading:
            import React from 'react';         import { AppRegistry } from 'react-native';         import ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required