From e83511057be4c3cd6739784e6ba25a482f570ca7 Mon Sep 17 00:00:00 2001 From: Zeeshan Tamboli Date: Wed, 30 Aug 2023 18:23:53 +0530 Subject: [PATCH] [Tabs] Fix `ref` type (#38717) --- packages/mui-material/src/Tabs/Tabs.d.ts | 3 +-- packages/mui-material/src/Tabs/Tabs.spec.tsx | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/mui-material/src/Tabs/Tabs.d.ts b/packages/mui-material/src/Tabs/Tabs.d.ts index 9f2fd56c34e764..a5c0d1949436ff 100644 --- a/packages/mui-material/src/Tabs/Tabs.d.ts +++ b/packages/mui-material/src/Tabs/Tabs.d.ts @@ -3,7 +3,6 @@ import { SxProps } from '@mui/system'; import { SlotComponentProps } from '@mui/base'; import { OverridableStringUnion } from '@mui/types'; import { Theme } from '../styles'; -import ButtonBase from '../ButtonBase'; import { TabScrollButtonProps } from '../TabScrollButton'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TabsClasses } from './tabsClasses'; @@ -176,7 +175,7 @@ export interface TabsOwnProps { export interface TabsTypeMap< AdditionalProps = {}, - RootComponent extends React.ElementType = typeof ButtonBase, + RootComponent extends React.ElementType = 'div', > { props: AdditionalProps & TabsOwnProps; defaultComponent: RootComponent; diff --git a/packages/mui-material/src/Tabs/Tabs.spec.tsx b/packages/mui-material/src/Tabs/Tabs.spec.tsx index c52c946895b1db..979f67adcf5477 100644 --- a/packages/mui-material/src/Tabs/Tabs.spec.tsx +++ b/packages/mui-material/src/Tabs/Tabs.spec.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import { expectType } from '@mui/types'; import Tabs from '@mui/material/Tabs'; import SvgIcon from '@mui/material/SvgIcon'; @@ -50,3 +51,10 @@ function SampleIcon() { }), }} />; + +// Test for ref type + { + expectType(elem); + }} +/>;