diff --git a/packages/mui-material/src/Tabs/ScrollbarSize.js b/packages/mui-material/src/Tabs/ScrollbarSize.js index 2811d02180205d..edea6b1620db1c 100644 --- a/packages/mui-material/src/Tabs/ScrollbarSize.js +++ b/packages/mui-material/src/Tabs/ScrollbarSize.js @@ -1,7 +1,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import debounce from '../utils/debounce'; -import { ownerWindow } from '../utils'; +import { ownerWindow, unstable_useEnhancedEffect as useEnhancedEffect } from '../utils'; const styles = { width: 99, @@ -25,7 +25,7 @@ export default function ScrollbarSize(props) { scrollbarHeight.current = nodeRef.current.offsetHeight - nodeRef.current.clientHeight; }; - React.useEffect(() => { + useEnhancedEffect(() => { const handleResize = debounce(() => { const prevHeight = scrollbarHeight.current; setMeasurements();