useInfiniteQuery with pull-to-refresh #1275
Unanswered
JeremyBradshaw7
asked this question in
Q&A
Replies: 3 comments 11 replies
-
You should call |
Beta Was this translation helpful? Give feedback.
7 replies
-
Can you share more detail @JeremyBradshaw7 about how you got this to work with Flatlist? what do you assign to the Flatlist data when the hook returns an array of pages? I see assignedLearners but what is that? Thanks! |
Beta Was this translation helpful? Give feedback.
2 replies
-
Surely there is a better way to do this than reducing the data every time? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm in a react-native project using
useInifiniteQuery
which is working very nicely but I'm now adding pull-to-refresh functionality on the Flatlist:It's querying the back-end for page 1 again but it's just appending this to the paged data that has already been fetched (whether that's just the first page or several pages). How do I force it to clear the buffered data and start again from page 1? I've tried setting the staleTime to 0 when I'm refreshing but no joy.
Beta Was this translation helpful? Give feedback.
All reactions