O'Reilly logo

React Native - Building Mobile Apps with JavaScript by Vladimir Novick

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

ActivityIndicator

ActivityIndicator is basically a spinning loader, which you are familiar with from dozens of apps. It's probably one of the smallest components in React Native. In addition to View props, it has the following three props:

  • animating: Boolean prop that should be passed, so the component will determine whether it's animating or not
  • color:: You can change the foreground color of the spinner
  • size: You can pass a small or large string to indicate whether ActivityIndicator is small or large; for Android, you can pass size prop to configure exact dimensions

Let's take a look at what an activity indicator looks like. Let's use the same screen we used before with the ShowInstructions button, but this time let's delay showing instructions ...

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