export default function App() {
const [isFetching, setIsFetching] = React.useState(false);
const renderItem = ({ item }) => <Item title={item.title} />;
const onRefresh = async () => {
setIsFetching(true);
await yourAsyncFunction;
setIsFetching(false);
};
return (
<View>
<FlatList
data={flatListItems}
onRefresh={onRefresh}
refreshing={isFetching}
renderItem={renderItem}
keyExtractor={(item) => item.id}
/>
</View>
);
}