Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlatList refresh control #598

Closed
tallen11 opened this issue May 3, 2019 · 12 comments
Closed

FlatList refresh control #598

tallen11 opened this issue May 3, 2019 · 12 comments

Comments

@tallen11
Copy link

tallen11 commented May 3, 2019

Replacing the standard react-native FlatList with the one from this library has made refreshing not work. I'm setting the refreshing and onRefresh props like normal and no refresh control appears. Is there further setup for this library?

@osdnk
Copy link
Contributor

osdnk commented May 22, 2019

Could you add some example? I'm using it and it works okay for me

@osdnk osdnk closed this as completed May 22, 2019
@harryfinn
Copy link

harryfinn commented Jul 5, 2019

@tallen11 - I had the same issue, appears that the FlatList component from the gesture handler lib doesn't support onRefresh & refreshing props directly on the component, like the RN component. Instead add the RefreshControl element prop to the FlatList component like so:

<FlatList
  refreshControl={
    <RefreshControl
      refreshing={this.state.isRefreshing}
      onRefresh={() => this.refreshMethod()}
    />
  }
/>

@re-za
Copy link

re-za commented Nov 18, 2020

I have the same problem.

@osdnk - Let say we have the following:
<FlatList data={data} renderItem={renderItem} refreshControl={ <RefreshControl refreshing={refreshing} onRefresh={onRefresh} /> } />;

I've realized that RNGH behaves differently in the two following scenarios:

  1. RefreshControl works if renderItem has the following shape:
    const renderItem = () => ( <View> <Text>Foo</Text> </View> )

  2. But it doesn't work for the following:
    const renderItem = () => ( <View> <Text>Foo</Text> <Text>Bar</Text> </View> )

No idea what is causing this though

@haibert
Copy link

haibert commented Jun 4, 2021

Any answers for this? im having the same issue

@ireshdudeja
Copy link

@tallen11 - I had the same issue, appears that the FlatList component from the gesture handler lib doesn't support onRefresh & refreshing props directly on the component, like the RN component. Instead add the RefreshControl element prop to the FlatList component like so:

<FlatList
  refreshControl={
    <RefreshControl
      refreshing={this.state.isRefreshing}
      onRefresh={() => this.refreshMethod()}
    />
  }
/>

On iOS it worked, but on android it doesn't work (when the list is large).

@gdoudeng
Copy link

Is there any way to solve this problem?

@vishalnarkhede
Copy link

@osdnk I am facing the same issue. So pull-to-refresh works perfectly fine on iOS. Although on Android, if the list size is more than the screen-size (basically when scroll shows up) - in that case pull-to-refresh doesn't work. I have setup an Expo snack to reproduce this issue - https://snack.expo.io/@vishalnarkhede/gesture-handler-flatlist-issue

@exzos28
Copy link

exzos28 commented Feb 7, 2022

The problem is actual

@swizes
Copy link

swizes commented Mar 30, 2022

@osdnk This issue should be reopened. On iOS it works, on Android it does not.

@Livijn
Copy link

Livijn commented Apr 26, 2022

@vishalnarkhede You should create a new issue for this.

@Fortidude
Copy link

Still have the issue on android

@iasinov
Copy link

iasinov commented Nov 28, 2023

For those experiencing this issue on Android, ensure that you import RefreshControl from react-native-gesture-handler, not from react-native.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests