Skip to content

Commit 2e098c4

Browse files
committed
Revert "Use Number.isNaN with a typeof check"
This reverts commit 382f3c3.
1 parent 382f3c3 commit 2e098c4

File tree

1 file changed

+3
-8
lines changed
  • packages/mui-material/src/Tabs

1 file changed

+3
-8
lines changed

packages/mui-material/src/Tabs/Tabs.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,9 @@ const Tabs = React.forwardRef(function Tabs(inProps, ref) {
420420
[size]: tabMeta ? tabMeta[size] : 0,
421421
};
422422

423-
if (
424-
!(
425-
typeof indicatorStyle[startIndicator] === 'number' &&
426-
!Number.isNaN(indicatorStyle[startIndicator]) &&
427-
typeof indicatorStyle[size] === 'number' &&
428-
!Number.isNaN(indicatorStyle[size])
429-
)
430-
) {
423+
// IE11 support, replace with Number.isNaN
424+
// eslint-disable-next-line no-restricted-globals
425+
if (isNaN(indicatorStyle[startIndicator]) || isNaN(indicatorStyle[size])) {
431426
setIndicatorStyle(newIndicatorStyle);
432427
} else {
433428
const dStart = Math.abs(indicatorStyle[startIndicator] - newIndicatorStyle[startIndicator]);

0 commit comments

Comments
 (0)