diff --git a/src/_common b/src/_common index 3e32b8cfa..4ab51d431 160000 --- a/src/_common +++ b/src/_common @@ -1 +1 @@ -Subproject commit 3e32b8cfa24c4ac7504fb54bff9ef0be026413d2 +Subproject commit 4ab51d431767c2691ff9064fdf1f200a63abee1f diff --git a/src/tabs/TabNav.tsx b/src/tabs/TabNav.tsx index d75d09543..01265aa98 100644 --- a/src/tabs/TabNav.tsx +++ b/src/tabs/TabNav.tsx @@ -31,6 +31,7 @@ const TabNav: React.FC = (props) => { onRemove = noop, onChange = noop, activeValue, + children, } = props; // 逻辑层较多处需要判断是否为 card 类型,进行逻辑抽象 @@ -106,7 +107,9 @@ const TabNav: React.FC = (props) => { setToLeftBtnVisible(canToleft); setToRightBtnVisible(canToRight); - }, [scrollLeft, placement]); + // children 发生变化也要触发一次切换箭头判断 + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [scrollLeft, placement, children]); // 滚动条处理逻辑 const handleScroll = (position: 'left' | 'right') => {