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
This commit is contained in:
HAMPLENI
2017-07-21 19:00:35 -07:00
committed by Wesley Wigham
parent cad18fc7ad
commit 01764b65da
+2 -1
View File
@@ -8057,7 +8057,8 @@ export namespace Animated {
type Mapping = { [key: string]: Mapping } | AnimatedValue;
interface EventConfig {
listener?: ValueListenerCallback
listener?: ValueListenerCallback;
useNativeDriver?: boolean;
}
/**