Skip to content

Commit 53c8f5e

Browse files
authored
TabBarItem - support array styles (#2812)
1 parent ff7ce73 commit 53c8f5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/tabController/TabBarItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ export default function TabBarItem({
138138
const itemWidth = useRef(props.width);
139139
const isPressed = useSharedValue(false);
140140
// JSON.parse(JSON.stringify is due to an issue with reanimated
141-
const sharedLabelStyle = useSharedValue(JSON.parse(JSON.stringify(labelStyle)));
142-
const sharedSelectedLabelStyle = useSharedValue(JSON.parse(JSON.stringify(selectedLabelStyle)));
141+
const sharedLabelStyle = useSharedValue(JSON.parse(JSON.stringify(StyleSheet.flatten(labelStyle))));
142+
const sharedSelectedLabelStyle = useSharedValue(JSON.parse(JSON.stringify(StyleSheet.flatten(selectedLabelStyle))));
143143

144144
// NOTE: We clone these color values in refs because they might contain a PlatformColor value
145145
// which throws an error (see https://github.com/software-mansion/react-native-reanimated/issues/3164)

0 commit comments

Comments
 (0)