Make feed refreshable

This commit is contained in:
aeroreyna
2022-03-08 20:25:57 -08:00
parent 82e0ded56c
commit c585d9fae8
2 changed files with 8 additions and 1 deletions

View File

@@ -41,6 +41,10 @@ let Profile = ({ navigation, route }) => {
renderItem={renderPost}
keyExtractor={item => item._id || item.createdAt}
ListHeaderComponent={<NewPost newPostCB={(newPost) => setPosts([newPost, ...Posts])} />}
refreshing={Posts.length === 0}
onRefresh={()=>{
API.getPosts(route.params.profileid).then(setPosts);
}}
/>
}
</View>