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 does not work correctly on state change

See original GitHub issue

React Native version: 0.59.8

Steps To Reproduce

  1. Pull down on list, refresh control appears (as it should)
  2. Press button on top of list to load data, refresh control does not appear even though refreshing is true. You can also this is true by pressing the button first, the pulling down, then finally pressing the button again.

Describe what you expected to happen: The refresh control should appear whenever refreshing is true

Snack, code example, or link to a repository: https://snack.expo.io/ByZXxOuhV

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:19
  • Comments:23

github_iconTop GitHub Comments

15reactions
emagniercommented, Jun 3, 2020

still an issue on v0.62.2 when <RefreshControl /> is enabled (with local state) from a useEffect function.

9reactions
rdinizzcommented, Mar 19, 2020

If anyone is still having problems with this:

I found a workaround that is just enabling the bounce.

I had bounces={false} and after removing it, it’s working on iOS now(Android was already working)

But in my case, the loading didn’t appear not even once.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pull to Refresh and setState not working - React Native
onRefresh called the function "refreshcontrol()" see code below. I need to change my state "refreshing" to true before I fetch from my API....
Read more >
RefreshControl - React Native
This component is used inside a ScrollView or ListView to add pull to refresh functionality. When the ScrollView is at scrollY: 0 ,...
Read more >
Pull To Refresh And Setstate Not Working React Native
Attempting to change the refresh control while it is not idle is strongly discouraged and probably won't work properly. I'm honestly surprised this...
Read more >
React Native Tutorial 32 - RefreshControl - YouTube
Welcome to this course on React Native, React Native is used hybrid mobile app development. Facebook's React Native user interface (UI) ...
Read more >
React Native Pull-to-Refresh: Make Refreshing Easy for Users
While using RefreshControl, you'll need to handle the state of the component. The refreshing prop indicates whether the refresh is active or not ......
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