From 9f391fc33526ae08ca23a1b04d66f72ccb7b54d6 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Thu, 9 Apr 2020 22:55:53 +0200 Subject: [PATCH] Fixed tab bar color not updating with theme change --- src/navigation/MainTabNavigator.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/navigation/MainTabNavigator.js b/src/navigation/MainTabNavigator.js index a7c1166..f52a513 100644 --- a/src/navigation/MainTabNavigator.js +++ b/src/navigation/MainTabNavigator.js @@ -234,13 +234,11 @@ type Props = { class TabNavigator extends React.Component{ createHomeStackComponent: Object; - colors: Object; defaultRoute: string; constructor(props) { super(props); - this.colors = props.theme.colors; this.defaultRoute = AsyncStorageManager.getInstance().preferences.defaultStartScreen.current.toLowerCase(); if (props.defaultRoute !== null) @@ -253,7 +251,7 @@ class TabNavigator extends React.Component{ return ( ({ tabBarIcon: ({focused, color, size}) => { let icon = TAB_ICONS[route.name]; @@ -262,8 +260,8 @@ class TabNavigator extends React.Component{ return ; }, })} - activeColor={this.colors.primary} - inactiveColor={this.colors.tabIcon} + activeColor={this.props.theme.colors.primary} + inactiveColor={this.props.theme.colors.tabIcon} >