@@ -31,7 +31,6 @@ import { Grid } from '../Grid';
3131import { isElement } from 'react-is' ;
3232import { Tooltip } from '../Tooltip' ;
3333import { useControllableState } from '../../internal/useControllableState' ;
34- import { useEffectOnce } from '../../internal/useEffectOnce' ;
3534import { useId } from '../../internal/useId' ;
3635import useIsomorphicEffect from '../../internal/useIsomorphicEffect' ;
3736import { useMergedRefs } from '../../internal/useMergedRefs' ;
@@ -601,15 +600,15 @@ function TabList({
601600 }
602601 }
603602
604- useEffectOnce ( ( ) => {
603+ useEffect ( ( ) => {
605604 const tab = tabs . current [ selectedIndex ] ;
606605 if ( scrollIntoView && tab ) {
607606 tab . scrollIntoView ( {
608607 block : 'nearest' ,
609608 inline : 'nearest' ,
610609 } ) ;
611610 }
612- } ) ;
611+ } , [ ] ) ;
613612
614613 useEffect ( ( ) => {
615614 //adding 1 in calculation for firefox support
@@ -627,7 +626,7 @@ function TabList({
627626 }
628627 } , [ scrollLeft , children , dismissable , isScrollable ] ) ;
629628
630- useEffectOnce ( ( ) => {
629+ useEffect ( ( ) => {
631630 if ( tabs . current [ selectedIndex ] ?. disabled ) {
632631 const activeTabs = tabs . current . filter ( ( tab ) => {
633632 return ! tab . disabled ;
@@ -638,7 +637,7 @@ function TabList({
638637 setSelectedIndex ( tabs . current . indexOf ( tab ) ) ;
639638 }
640639 }
641- } ) ;
640+ } , [ ] ) ;
642641
643642 useIsomorphicEffect ( ( ) => {
644643 if ( ref . current ) {
@@ -941,7 +940,7 @@ function TabListVertical({
941940 }
942941 }
943942
944- useEffectOnce ( ( ) => {
943+ useEffect ( ( ) => {
945944 if ( tabs . current [ selectedIndex ] ?. disabled ) {
946945 const activeTabs = tabs . current . filter ( ( tab ) => {
947946 return ! tab . disabled ;
@@ -952,7 +951,7 @@ function TabListVertical({
952951 setSelectedIndex ( tabs . current . indexOf ( tab ) ) ;
953952 }
954953 }
955- } ) ;
954+ } , [ ] ) ;
956955
957956 useEffect ( ( ) => {
958957 function handler ( ) {
@@ -1666,7 +1665,7 @@ const TabPanel = React.forwardRef<HTMLDivElement, TabPanelProps>(
16661665 [ `${ prefix } --tab-content--interactive` ] : interactiveContent ,
16671666 } ) ;
16681667
1669- useEffectOnce ( ( ) => {
1668+ useEffect ( ( ) => {
16701669 if ( ! panel . current ) {
16711670 return ;
16721671 }
@@ -1676,7 +1675,7 @@ const TabPanel = React.forwardRef<HTMLDivElement, TabPanelProps>(
16761675 setInteractiveContent ( true ) ;
16771676 setTabIndex ( - 1 ) ;
16781677 }
1679- } ) ;
1678+ } , [ ] ) ;
16801679
16811680 // tabindex should only be 0 if no interactive content in children
16821681 useEffect ( ( ) => {
0 commit comments