React Native RefreshControl for all application screens

Viewed 574

According to the documentation i would have to implement RefreshControl on every screen of my app on ScrollView or FlatList.

Is there any way to wrap all my application with RefreshControl component?

2 Answers

Yes just make your own Flatlist component with refresh control and pass the same props the normal Flatlist takes then call it wherever you use a flatlist

you can use prop onRefresh for swipe refresh

<FlatList
    data={ this.state.FlatListItems }
    onRefresh={() => this.onRefresh()}
    refreshing={this.state.isFetching}
/>

for more info see this

Related