1
1
import * as React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
- import { OverridableComponent } from '@mui/types' ;
4
3
import { unstable_useForkRef as useForkRef } from '@mui/utils' ;
5
4
import composeClasses from '../composeClasses' ;
6
5
import { getTabUtilityClass } from './tabClasses' ;
7
6
import { TabProps , TabTypeMap , TabRootSlotProps , TabOwnerState } from './Tab.types' ;
8
7
import useTab from '../useTab' ;
9
- import { useSlotProps , WithOptionalOwnerState } from '../utils' ;
8
+ import { PolymorphicComponent , useSlotProps , WithOptionalOwnerState } from '../utils' ;
10
9
import { useClassNamesOverride } from '../utils/ClassNameConfigurator' ;
11
10
12
11
const useUtilityClasses = ( ownerState : TabOwnerState ) => {
@@ -40,7 +39,6 @@ const Tab = React.forwardRef(function Tab<RootComponentType extends React.Elemen
40
39
onChange,
41
40
onClick,
42
41
onFocus,
43
- component,
44
42
slotProps = { } ,
45
43
slots = { } ,
46
44
...other
@@ -64,7 +62,7 @@ const Tab = React.forwardRef(function Tab<RootComponentType extends React.Elemen
64
62
65
63
const classes = useUtilityClasses ( ownerState ) ;
66
64
67
- const TabRoot : React . ElementType = component ?? slots . root ?? 'button' ;
65
+ const TabRoot : React . ElementType = slots . root ?? 'button' ;
68
66
const tabRootProps : WithOptionalOwnerState < TabRootSlotProps > = useSlotProps ( {
69
67
elementType : TabRoot ,
70
68
getSlotProps : getRootProps ,
@@ -78,7 +76,7 @@ const Tab = React.forwardRef(function Tab<RootComponentType extends React.Elemen
78
76
} ) ;
79
77
80
78
return < TabRoot { ...tabRootProps } > { children } </ TabRoot > ;
81
- } ) as OverridableComponent < TabTypeMap > ;
79
+ } ) as PolymorphicComponent < TabTypeMap > ;
82
80
83
81
Tab . propTypes /* remove-proptypes */ = {
84
82
// ----------------------------- Warning --------------------------------
0 commit comments