scrollY: 0, swiping down triggers an onRefresh event.
Example
Props
boolean
required
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.() => void | Promise<void>
Called when the view starts refreshing.
number
Progress view top offset.
iOS-Specific Props
ColorValue
The color of the refresh indicator.Platform: iOS
string
The title displayed under the refresh indicator.Platform: iOS
ColorValue
The color of the refresh indicator title.Platform: iOS
Android-Specific Props
Array<ColorValue>
The colors (at least one) that will be used to draw the refresh indicator.Platform: Android
boolean
default:true
Whether the pull to refresh functionality is enabled.Platform: Android
ColorValue
The background color of the refresh indicator.Platform: Android
'default' | 'large'
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: