Skip to content

Commit

Permalink
fix(Tabs): when childrenList updated, titleRefs are not updated and r…
Browse files Browse the repository at this point in the history
…ecalculate lineStyle (#675)
  • Loading branch information
Trojan0523 authored Sep 4, 2023
1 parent a1c35fe commit 8375695
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-vant/src/components/tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const Tabs = forwardRef<TabsInstance, TabsProps>((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(() => {
Expand Down

0 comments on commit 8375695

Please sign in to comment.