O'Reilly logo

React Native By Example by Richard Kho

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

Using ActivityIndicator

The ActivityIndicator component displays a circular loading indicator that lets you visualize a loading action for the user. It's helpful for the overall user experience since your users shouldn't feel like their actions aren't accomplishing their intentions.

The two ActivityIndicator props we will use in this app are as follows:

  • animating: This is a Boolean that either shows or hides the component. It defaults to true.
  • size: This is the physical size of the component. On iOS, your options are one of two strings: small and large. On Android, in addition to those two strings, you can pass it a number. This prop defaults to small.

We should modify our app to show this ActivityIndicator when data hasn't been loaded ...

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