@@ -86,15 +86,15 @@ export default class TabBarItem<T extends Route> extends React.Component<
86
86
route,
87
87
position,
88
88
navigationState,
89
- renderLabel : renderLabelPassed ,
89
+ renderLabel : renderLabelCustom ,
90
90
renderIcon,
91
91
renderBadge,
92
92
getLabelText,
93
93
getTestID,
94
94
getAccessibilityLabel,
95
95
getAccessible,
96
- activeColor = DEFAULT_ACTIVE_COLOR ,
97
- inactiveColor = DEFAULT_INACTIVE_COLOR ,
96
+ activeColor : activeColorCustom ,
97
+ inactiveColor : inactiveColorCustom ,
98
98
pressColor,
99
99
pressOpacity,
100
100
labelStyle,
@@ -107,6 +107,21 @@ export default class TabBarItem<T extends Route> extends React.Component<
107
107
const tabIndex = navigationState . routes . indexOf ( route ) ;
108
108
const isFocused = navigationState . index === tabIndex ;
109
109
110
+ const labelColorFromStyle = StyleSheet . flatten ( labelStyle || { } ) . color ;
111
+
112
+ const activeColor =
113
+ activeColorCustom !== undefined
114
+ ? activeColorCustom
115
+ : typeof labelColorFromStyle === 'string'
116
+ ? labelColorFromStyle
117
+ : DEFAULT_ACTIVE_COLOR ;
118
+ const inactiveColor =
119
+ inactiveColorCustom !== undefined
120
+ ? inactiveColorCustom
121
+ : typeof labelColorFromStyle === 'string'
122
+ ? labelColorFromStyle
123
+ : DEFAULT_INACTIVE_COLOR ;
124
+
110
125
const activeOpacity = this . getActiveOpacity (
111
126
position ,
112
127
navigationState . routes ,
@@ -150,8 +165,8 @@ export default class TabBarItem<T extends Route> extends React.Component<
150
165
}
151
166
152
167
const renderLabel =
153
- renderLabelPassed !== undefined
154
- ? renderLabelPassed
168
+ renderLabelCustom !== undefined
169
+ ? renderLabelCustom
155
170
: ( { route, color } : { route : T ; color : string } ) => {
156
171
const labelText = getLabelText ( { route } ) ;
157
172
0 commit comments