Skip to content

Commit

Permalink
Add default scrollEventThrottle to Animated{FlatList, SectionList} (#…
Browse files Browse the repository at this point in the history
…24954)

Summary:
`scrollEventThrottle` is often a source of confusion, especially when using native animated since users expect that it doesn't affect `Animated.event` but it does. We added a default prop to Animated.ScrollView but not to `Animated.FlatList` and `Animated.SectionList` so this adds it for those.

## Changelog

[JavaScript] [Added] - Add default scrollEventThrottle to Animated{FlatList, SectionList}
Pull Request resolved: #24954

Differential Revision: D15411998

Pulled By: cpojer

fbshipit-source-id: 41589a96c0a8b75ae7cf3169ccef363ac5140ad3
  • Loading branch information
janicduplessis authored and facebook-github-bot committed May 20, 2019
1 parent 0ac2171 commit 933e65e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Libraries/Animated/src/components/AnimatedFlatList.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ const FlatList = require('../../../Lists/FlatList');

const createAnimatedComponent = require('../createAnimatedComponent');

module.exports = createAnimatedComponent(FlatList);
module.exports = createAnimatedComponent(FlatList, {
scrollEventThrottle: 0.0001,
});
4 changes: 3 additions & 1 deletion Libraries/Animated/src/components/AnimatedSectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ const SectionList = require('../../../Lists/SectionList');

const createAnimatedComponent = require('../createAnimatedComponent');

module.exports = createAnimatedComponent(SectionList);
module.exports = createAnimatedComponent(SectionList, {
scrollEventThrottle: 0.0001,
});

0 comments on commit 933e65e

Please sign in to comment.