From 01764b65dafff52df5aa72519563e2349acdd300 Mon Sep 17 00:00:00 2001 From: HAMPLENI Date: Fri, 21 Jul 2017 22:00:35 -0400 Subject: [PATCH] Adding useNativeDriver to EventConfig (#18302) The AnimatedEvent class's constructor takes in a config parameter of type EventConfig. This config object is passed to shouldUseNativeDriver, which only returns something other than false if useNativeDriver is ever set. A case when useNativeDriver is set to true is when Animated.Event is used for an Animated.ScrollView's onScroll prop. https://facebook.github.io/react-native/blog/2017/02/14/using-native-driver-for-animated.html --- types/react-native/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index e8e9eca55c..4b9ef8c075 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -8057,7 +8057,8 @@ export namespace Animated { type Mapping = { [key: string]: Mapping } | AnimatedValue; interface EventConfig { - listener?: ValueListenerCallback + listener?: ValueListenerCallback; + useNativeDriver?: boolean; } /**