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.
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.
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 MainApp from './src/MainApp'; AppRegistry.registerComponent('ButtonLoading', () => MainApp);
Open the
index.android.js
file, remove the existing code and add the following. The code is a little bit different...