From 61c8812048290e7180fc129fc2b34629c2f923e6 Mon Sep 17 00:00:00 2001 From: Danny Cochran Date: Sat, 15 Oct 2016 13:18:53 -0700 Subject: [PATCH] Use native bridge for animations Basically patches in the change from https://github.com/facebook/react-native/pull/10289/files. Once the above commit is merged into RN and pushed to a stable release, this can be merged. It won't be backwards compatible with older versions of RN, however. --- NavigationAnimatedView.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/NavigationAnimatedView.js b/NavigationAnimatedView.js index c5abffc..024283f 100644 --- a/NavigationAnimatedView.js +++ b/NavigationAnimatedView.js @@ -53,6 +53,7 @@ function applyDefaultAnimation( Animated.spring( position, { + useNativeDriver: true, bounciness: 0, toValue: navigationState.index, } @@ -228,8 +229,14 @@ class NavigationAnimatedView isMeasured: true, }; - layout.height.setValue(height); - layout.width.setValue(width); + Animated.event([{ + nativeEvent: { + layout: { + height: height, + width: width, + }, + }, + }]); this.setState({ layout }); }