|
2 | 2 | import React, {PureComponent} from 'react';
|
3 | 3 | import {StyleSheet, /* processColor, */ TextStyle, LayoutChangeEvent, StyleProp, ViewStyle} from 'react-native';
|
4 | 4 | import _ from 'lodash';
|
5 |
| -import Reanimated from 'react-native-reanimated'; |
| 5 | +import Reanimated, {processColor} from 'react-native-reanimated'; |
6 | 6 | import {State} from 'react-native-gesture-handler';
|
7 | 7 | import {interpolateColor} from 'react-native-redash';
|
8 | 8 | import {Colors, Typography, Spacings} from '../../style';
|
@@ -228,12 +228,18 @@ export default class TabBarItem extends PureComponent<Props> {
|
228 | 228 | getIconStyle() {
|
229 | 229 | const {index, currentPage, iconColor, selectedIconColor, labelColor, selectedLabelColor, ignore} = this.props;
|
230 | 230 |
|
231 |
| - const activeColor = selectedIconColor || selectedLabelColor || DEFAULT_SELECTED_LABEL_COLOR; |
232 |
| - const inactiveColor = iconColor || labelColor || DEFAULT_LABEL_COLOR; |
| 231 | + let activeColor = selectedIconColor || selectedLabelColor || DEFAULT_SELECTED_LABEL_COLOR; |
| 232 | + let inactiveColor = iconColor || labelColor || DEFAULT_LABEL_COLOR; |
| 233 | + |
| 234 | + // TODO: Don't condition this once migrating completely to reanimated v2 |
| 235 | + if (processColor) { |
| 236 | + // @ts-ignore |
| 237 | + activeColor = processColor(activeColor); |
| 238 | + // @ts-ignore |
| 239 | + inactiveColor = processColor(inactiveColor); |
| 240 | + } |
233 | 241 |
|
234 | 242 | const tintColor = cond(eq(currentPage, index),
|
235 |
| - // TODO: using processColor here broke functionality, |
236 |
| - // not using it seem to not be very performant |
237 | 243 | activeColor,
|
238 | 244 | ignore ? activeColor : inactiveColor);
|
239 | 245 |
|
|
0 commit comments