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.

Flatlist - Pull to refresh not working when horizontal

See original GitHub issue

šŸ› Bug Report

I am trying to implement a pull to refresh in a horizontal FlatList in react-native version 0.57.7.

        <FlatList
          horizontal
          refreshing={requesting}
          onRefresh={() => console.log('Refresh')}
          data={cardsList}
          renderItem={({ item }) =>
            <EachCard
              {...item}
            />
        />

So at first when requesting is true, it shows the loader. But when i try to pull down to refresh, it doesn’t pull down and the onRefresh is also not triggered.

I also tried to each version from v057.7 to the latest 0.59.4. It also didn’t work.

Environment

  • react-native: v0.57.7 to v0.59.4
  • react: v16.6.3

react-native info

React Native Environment Info: System: OS: macOS High Sierra 10.13.6 CPU: (4) x64 IntelĀ® Coreā„¢ i5-7360U CPU @ 2.30GHz Memory: 713.56 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 11.3.0 - ~/.nvm/versions/node/v11.3.0/bin/node Yarn: 1.12.3 - /usr/local/bin/yarn npm: 6.4.1 - ~/.nvm/versions/node/v11.3.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: API Levels: 25, 26, 27, 28 Build Tools: 27.0.3, 28.0.2, 28.0.3 System Images: android-27 | Android TV Intel x86 Atom, android-27 | Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.8.3 => 16.8.3 react-native: 0.59.4 => 0.59.4 npmGlobalPackages: react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
karanpratapsinghcommented, Apr 12, 2019

@andreshsingh

Give this a try


<ScrollView
                    refreshControl={
                        <RefreshControl
                            tintColor={textColors.black}
                            refreshing={isSyncing}
                            onRefresh={this._onRefresh}
                        />
                    }
                    showsVerticalScrollIndicator={false}
                    contentContainerStyle={{ flexGrow: 1, alignSelf: 'center' }}>
                 

            // your horizontal list here

</ScrollView>
0reactions
stale[bot]commented, Aug 9, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native FlatList refreshing not working - Stack Overflow
i got an problem with the refreshing on pull function. The FlatList renders fine, but pull to refresh is not working.
Read more >
Usage | FlashList
FlashList attempts to measure size of horizontal lists by drawing an extra list item in advance. This can sometimes cause issues when usedĀ ......
Read more >
ScrollView - React Native
FlatList renders items lazily, when they are about to appear, and removes items that scroll way off screen to save memory and processing...
Read more >
SectionList - React Native
Pull to Refresh. Scroll loading. If you don't need section support and want a simpler interface, use <FlatList> .
Read more >
FlatList - React Native
Optional horizontal mode. ... Pull to Refresh. ... Without setting this prop, FlatList would not know it needs to re-render any itemsĀ ...
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