Skip to content

Commit db60685

Browse files
authored
added disableIconTintColor prop to TabController.TabBarItem (#1314)
* added `disableIconTintColor` prop * replaced empty obj with undefined
1 parent f0eb00c commit db60685

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/components/tabController/TabBarItem.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ export interface TabControllerItemProps {
9292
* Used as a testing identifier
9393
*/
9494
testID?: string;
95+
/**
96+
* disables icon's tint color
97+
*/
98+
disableIconTintColor?: boolean;
9599
}
96100

97101
interface Props extends TabControllerItemProps {
@@ -226,7 +230,20 @@ export default class TabBarItem extends PureComponent<Props> {
226230
}
227231

228232
getIconStyle() {
229-
const {index, currentPage, iconColor, selectedIconColor, labelColor, selectedLabelColor, ignore} = this.props;
233+
const {
234+
index,
235+
currentPage,
236+
iconColor,
237+
selectedIconColor,
238+
labelColor,
239+
selectedLabelColor,
240+
ignore,
241+
disableIconTintColor
242+
} = this.props;
243+
244+
if (disableIconTintColor) {
245+
return undefined;
246+
}
230247

231248
let activeColor = selectedIconColor || selectedLabelColor || DEFAULT_SELECTED_LABEL_COLOR;
232249
let inactiveColor = iconColor || labelColor || DEFAULT_LABEL_COLOR;

0 commit comments

Comments
 (0)