From f36d2c00208f13f825fa5842e9e81ac84dd73e7b Mon Sep 17 00:00:00 2001 From: trojan0523 <1153532327@qq.com> Date: Sun, 3 Sep 2023 13:12:44 +0800 Subject: [PATCH] fix(Tabs): when childrenList updated, titleRefs are not updated and recalculate lineStyle --- packages/react-vant/src/components/tabs/Tabs.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-vant/src/components/tabs/Tabs.tsx b/packages/react-vant/src/components/tabs/Tabs.tsx index bcf1586b9..00a492d73 100644 --- a/packages/react-vant/src/components/tabs/Tabs.tsx +++ b/packages/react-vant/src/components/tabs/Tabs.tsx @@ -128,7 +128,7 @@ const Tabs = forwardRef((p, ref) => { } setShowLine(true) setLineTranslateLeft(title.offsetLeft + title.offsetWidth / 2) - }, [root.current, titleRefs, props.type, index]) + }, [root.current, titleRefs, props.type, index, childrenList]) // 下划线样式 const lineStyle = useMemo(() => {