From 8bb707b6869624e4e133f9db7d29d627d9a18290 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Tue, 1 Nov 2016 15:52:23 -0700 Subject: [PATCH] Use native animations in TouchableBounce and TouchableOpacity Summary: this brings back the previous commit that had to be reverted due to internal breakages. original commit: https://github.com/facebook/react-native/commit/1bb323e256bb6ad7b9f757368e69cf682f71d7ac Reviewed By: AaaChiuuu Differential Revision: D4109811 fbshipit-source-id: b50de145eaf6851138429635bc0302518d656b75 --- Libraries/Components/Touchable/TouchableBounce.js | 1 + Libraries/Components/Touchable/TouchableOpacity.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/Components/Touchable/TouchableBounce.js b/Libraries/Components/Touchable/TouchableBounce.js index 881713344..eadcd3981 100644 --- a/Libraries/Components/Touchable/TouchableBounce.js +++ b/Libraries/Components/Touchable/TouchableBounce.js @@ -88,6 +88,7 @@ var TouchableBounce = React.createClass({ toValue: value, velocity, bounciness, + useNativeDriver: true, }).start(callback); }, diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index dba277297..cbad6a89b 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -87,7 +87,7 @@ var TouchableOpacity = React.createClass({ setOpacityTo: function(value: number) { Animated.timing( this.state.anim, - {toValue: value, duration: 150} + {toValue: value, duration: 150, useNativeDriver: true} ).start(); },