From fb361fa9935730143e481a806e235b94265d28e3 Mon Sep 17 00:00:00 2001 From: Siriwat K Date: Mon, 18 Mar 2024 10:18:41 +0700 Subject: [PATCH] [material-ui] Use interface instead of type for props (#41500) --- packages/mui-base/src/Unstable_Popup/Popup.tsx | 6 +++--- packages/mui-material/src/Popper/Popper.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/mui-base/src/Unstable_Popup/Popup.tsx b/packages/mui-base/src/Unstable_Popup/Popup.tsx index 0b0a90cfde1dc9..4281b239ebbb6b 100644 --- a/packages/mui-base/src/Unstable_Popup/Popup.tsx +++ b/packages/mui-base/src/Unstable_Popup/Popup.tsx @@ -16,10 +16,10 @@ import { } from '@mui/utils'; import { unstable_composeClasses as composeClasses } from '../composeClasses'; import { Portal } from '../Portal'; -import { useSlotProps, WithOptionalOwnerState } from '../utils'; +import { useSlotProps, WithOptionalOwnerState, PolymorphicComponent } from '../utils'; import { useClassNamesOverride } from '../utils/ClassNameConfigurator'; import { getPopupUtilityClass } from './popupClasses'; -import { PopupOwnerState, PopupProps, PopupRootSlotProps } from './Popup.types'; +import { PopupOwnerState, PopupProps, PopupRootSlotProps, PopupTypeMap } from './Popup.types'; import { useTransitionTrigger, TransitionContext } from '../useTransition'; import { PopupContext, PopupContextValue } from './PopupContext'; @@ -154,7 +154,7 @@ const Popup = React.forwardRef(function Popup ); -}); +}) as PolymorphicComponent; Popup.propTypes /* remove-proptypes */ = { // ┌────────────────────────────── Warning ──────────────────────────────┐ diff --git a/packages/mui-material/src/Popper/Popper.tsx b/packages/mui-material/src/Popper/Popper.tsx index 6609e81a78b2a1..3d946e9e32adf8 100644 --- a/packages/mui-material/src/Popper/Popper.tsx +++ b/packages/mui-material/src/Popper/Popper.tsx @@ -8,7 +8,7 @@ import PropTypes from 'prop-types'; import * as React from 'react'; import { styled, Theme, useThemeProps } from '../styles'; -export type PopperProps = Omit & { +export interface PopperProps extends Omit { /** * The component used for the root node. * Either a string to use a HTML element or a component. @@ -31,7 +31,7 @@ export type PopperProps = Omit & { * The system prop that allows defining system overrides as well as additional CSS styles. */ sx?: SxProps; -}; +} const PopperRoot = styled(BasePopper, { name: 'MuiPopper',