Skip to content

Commit 8375695

Browse files
authored
fix(Tabs): when childrenList updated, titleRefs are not updated and recalculate lineStyle (#675)
1 parent a1c35fe commit 8375695

File tree

1 file changed

+1
-1
lines changed
  • packages/react-vant/src/components/tabs

1 file changed

+1
-1
lines changed

packages/react-vant/src/components/tabs/Tabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const Tabs = forwardRef<TabsInstance, TabsProps>((p, ref) => {
128128
}
129129
setShowLine(true)
130130
setLineTranslateLeft(title.offsetLeft + title.offsetWidth / 2)
131-
}, [root.current, titleRefs, props.type, index])
131+
}, [root.current, titleRefs, props.type, index, childrenList])
132132

133133
// 下划线样式
134134
const lineStyle = useMemo(() => {

0 commit comments

Comments
 (0)