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.

VirtualizedList has hard coded scrollEventThrottle value

See original GitHub issue

Description

We’re doing animations based on onScroll in a <FlatList>, but the result is choppy in iOS. We tried setting scrollEventThrottle={16} on the <FlatList> component itself, then inside a renderScrollComponent function. No surprise it didn’t work, since it gets overridden in VirtualizedList.

Clearly there’s some thought behind setting it to 50, and some concern about Android where the property has no effect, but is it critical? Our Flatlists work pretty well on Android as is, after all… and setting a lower throttle doesn’t seem to have any catastrophic side effects on iOS.

Solution

It all depends on what the original reason for hard coding the value to 50 was, but if it was just some happy performance middle ground, then allow it to be overridden by property on the component. @sahrens is a clever guy and will have a great answer I’m sure.

Additional Information

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sahrenscommented, May 12, 2017

@andreleon: changing the throttle is not supported, you’ll need to manage it in your own code, e.g. with a Batchinator

Read more comments on GitHub >

github_iconTop Results From Across the Web

ScrollView - React Native
scrollEventThrottle. iOS. ​ ... This controls how often the scroll event will be fired while scrolling (as a time interval in ms). A...
Read more >
Get current scroll position of ScrollView in React Native
Fires while the user is dragging or while the scroll view is gliding, at some frequency determined by scrollEventThrottle and at most once ......
Read more >
decelerationrate flatlist | The AI Search Engine You Control
If the value prop is not updated, the component will continue to render the ... scrollEventThrottle={1} onScroll={onScrollEvent} data={filteredData.
Read more >
Blog · React Native - GitHub Pages
In practice this can happen a lot because user code runs on the ... Create the native value node, this is the value...
Read more >
Animated and React Native ScrollViews | by evening kid
This article is part of a series. If you are unfamiliar with the basics of animations ( Animated.Value , Animated.
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