question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

refreshControl doesn't work on Android

See original GitHub issue

Description

If I use FlatList with a custom component as children, the refresh control doesn’t show up on Android.

Screenshots

Steps To Reproduce

If I do this, the RefreshControl is shown in iOS but not in Android

<FlatList
  keyExtractor={item => item.id}
  refreshControl={
    <RefreshControl refreshing={refreshing} onRefresh={_fetchFeed} />
  }
  renderItem={({item}) => {
    return <MyCustomCard />;
  }}
/>

https://user-images.githubusercontent.com/7424471/118709844-e3b29680-b7f3-11eb-9f3c-250947afd3f2.mp4

but if I do this, it’s shown on both platforms

<FlatList
  keyExtractor={item => item.id}
  refreshControl={
    <RefreshControl refreshing={refreshing} onRefresh={_fetchFeed} />
  }
  renderItem={({item}) => {
    return <Text>Some text</Text>;
  }}
/>

https://user-images.githubusercontent.com/7424471/118710143-47d55a80-b7f4-11eb-83e2-5fd4f7cb9e76.mp4

Package versions

  • React: 17.0.1
  • React Native: 0.64.0
  • React Native Gesture Handler: 1.10.3

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
yfunkcommented, Jun 20, 2021

This seems to be the same issue as #1067. While there are some workarounds over there, the general “solution” seems to be ditching react-native-gesture-handler and using the ScrollView (or in this case FlatList) from react-native instead.

1reaction
zhou9110commented, May 24, 2021

Having the same issue in Android phones using library version 1.7.0, had no other workaround but to use the original FlatList from react-native

Package versions

React: 16.13.1 React Native: 0.64.1 (Expo 39) React Native Gesture Handler: 1.10.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Refresh Control not working on Android -React Native
When I have more then 5 records which means there is not empty space left on screen then the refresh control won't work....
Read more >
Refresh Control not working on Android -React Native-React ...
React Native local variable when used to initialise the state is updated on state update? The async-await does not work properly with useEffect()...
Read more >
RefreshControl - React Native
RefreshControl. This component is used inside a ScrollView or ListView to add pull to refresh functionality. When the ScrollView is at ...
Read more >
RefreshControl · React Native
RefreshControl. This component is used inside a ScrollView or ListView to add pull to refresh functionality. When the ScrollView is at scrollY: 0...
Read more >
RefreshControl - Pull to Refresh in React Native Apps - Enappd
Pull to Refresh Example in Android ... I made you laugh … didn't I ? ... This will create a basic React-native app...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found