Skip to content

Commit 933e65e

Browse files
janicduplessisfacebook-github-bot
authored andcommitted
Add default scrollEventThrottle to Animated{FlatList, SectionList} (#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
1 parent 0ac2171 commit 933e65e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Libraries/Animated/src/components/AnimatedFlatList.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ const FlatList = require('../../../Lists/FlatList');
1414

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

17-
module.exports = createAnimatedComponent(FlatList);
17+
module.exports = createAnimatedComponent(FlatList, {
18+
scrollEventThrottle: 0.0001,
19+
});

Libraries/Animated/src/components/AnimatedSectionList.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ const SectionList = require('../../../Lists/SectionList');
1414

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

17-
module.exports = createAnimatedComponent(SectionList);
17+
module.exports = createAnimatedComponent(SectionList, {
18+
scrollEventThrottle: 0.0001,
19+
});

0 commit comments

Comments
 (0)