From dc1d49e2e9f50ef89848e85ace1e6fb62051530f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Qu=E1=BB=91c=20Kh=C3=A1nh?= Date: Sat, 21 Sep 2024 19:43:54 +0700 Subject: [PATCH] fix(mobile): fix initial tabbar active position --- apps/mobile/components/common/tab-bar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/mobile/components/common/tab-bar.tsx b/apps/mobile/components/common/tab-bar.tsx index d5dbd3c2..2bee7e63 100644 --- a/apps/mobile/components/common/tab-bar.tsx +++ b/apps/mobile/components/common/tab-bar.tsx @@ -79,7 +79,7 @@ const TAB_BAR_ICONS = { const TAB_BAR_ITEM_WIDTH = (3 + 1) * rem.get() export function TabBar({ state, descriptors, navigation }: BottomTabBarProps) { - const tabIndicatorPosition = useSharedValue(0) + const tabIndicatorPosition = useSharedValue(state.index * TAB_BAR_ITEM_WIDTH) const animatedStyle = useAnimatedStyle(() => ({ transform: [{ translateX: tabIndicatorPosition.value }],