scrollY: 0, swiping down triggers an onRefresh event.
Example
Props
Whether the view should be indicating an active refresh.Note:
refreshing is a controlled prop, this is why it needs to be set to true in the onRefresh function otherwise the refresh indicator will stop immediately.Called when the view starts refreshing.
Progress view top offset.
iOS-Specific Props
The color of the refresh indicator.Platform: iOS
The title displayed under the refresh indicator.Platform: iOS
The color of the refresh indicator title.Platform: iOS
Android-Specific Props
The colors (at least one) that will be used to draw the refresh indicator.Platform: Android
Whether the pull to refresh functionality is enabled.Platform: Android
The background color of the refresh indicator.Platform: Android
Size of the refresh indicator.Platform: Android
Usage with FlatList
Platform Differences
iOS
- Shows a spinner-style refresh indicator
- Supports custom color via
tintColor - Can display a title below the spinner
- Smooth animation that follows the pull gesture
Android
- Shows a Material Design circular progress indicator
- Supports multiple colors via
colorsarray - Can set background color via
progressBackgroundColor - Has two size options:
'default'and'large' - Can be disabled via
enabledprop
Important Notes
- The
refreshingprop must be set totruein theonRefreshcallback for the refresh indicator to show - Remember to set
refreshingback tofalsewhen the refresh operation completes - The RefreshControl must be used as a child of a ScrollView, FlatList, or SectionList
- On iOS, the refresh control appears when you pull down from
scrollY: 0 - The
onRefreshcallback can return a Promise for async operations
Controlled Component Pattern
RefreshControl is a controlled component, meaning you must manage therefreshing state: