From 40bcae5d50f681b2c32f16d3840795f94ff5f1b6 Mon Sep 17 00:00:00 2001 From: Keeley Carrigan Date: Fri, 15 Dec 2017 02:23:20 -0500 Subject: [PATCH] Fix For React Navigation Beta 20+ (#62) --- lib/NavigationComponent.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/NavigationComponent.js b/lib/NavigationComponent.js index f096203..0379510 100644 --- a/lib/NavigationComponent.js +++ b/lib/NavigationComponent.js @@ -58,6 +58,7 @@ class NavigationComponent extends PureComponent { backgroundColor: bnOptions.backgroundColor, shifting: bnOptions.shifting } + const previousScene = navigationState.routes[navigationState.index] return ( { focused, tintColor: focused ? activeTintColor : inactiveTintColor } - const onPress = navigationGetOnPress(scene) + const onPress = navigationGetOnPress(previousScene, scene) const label = getLabel(scene) const icon = renderIcon(scene)