From 933e65e245b30f7dc5a26aa51881153fb7c3628e Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Mon, 20 May 2019 01:16:12 -0700 Subject: [PATCH] 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: https://github.com/facebook/react-native/pull/24954 Differential Revision: D15411998 Pulled By: cpojer fbshipit-source-id: 41589a96c0a8b75ae7cf3169ccef363ac5140ad3 --- Libraries/Animated/src/components/AnimatedFlatList.js | 4 +++- Libraries/Animated/src/components/AnimatedSectionList.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Libraries/Animated/src/components/AnimatedFlatList.js b/Libraries/Animated/src/components/AnimatedFlatList.js index 5ed02075ff6cd7..9e91e84d9a18d1 100644 --- a/Libraries/Animated/src/components/AnimatedFlatList.js +++ b/Libraries/Animated/src/components/AnimatedFlatList.js @@ -14,4 +14,6 @@ const FlatList = require('../../../Lists/FlatList'); const createAnimatedComponent = require('../createAnimatedComponent'); -module.exports = createAnimatedComponent(FlatList); +module.exports = createAnimatedComponent(FlatList, { + scrollEventThrottle: 0.0001, +}); diff --git a/Libraries/Animated/src/components/AnimatedSectionList.js b/Libraries/Animated/src/components/AnimatedSectionList.js index e0c94ea88933ca..115e48d443cc3f 100644 --- a/Libraries/Animated/src/components/AnimatedSectionList.js +++ b/Libraries/Animated/src/components/AnimatedSectionList.js @@ -14,4 +14,6 @@ const SectionList = require('../../../Lists/SectionList'); const createAnimatedComponent = require('../createAnimatedComponent'); -module.exports = createAnimatedComponent(SectionList); +module.exports = createAnimatedComponent(SectionList, { + scrollEventThrottle: 0.0001, +});