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 totrue
.size
: This is the physical size of the component. On iOS, your options are one of two strings:small
andlarge
. On Android, in addition to those two strings, you can pass it a number. This prop defaults tosmall
.
We should modify our app to show this ActivityIndicator
when data hasn't been loaded from the Graph API.
Let's modify the App
component so that it conditionally renders the ActivityIndicator
component when data has not yet been saved into the feed
property of the App
component's state.
The solution I came up with is as follows:
// Friends/app/App...