From 738da1632a6fc8034550388e3b30f994712cfac4 Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Fri, 15 Mar 2024 11:27:55 +0700 Subject: [PATCH 1/2] use interface instead of type --- packages/mui-material/src/Popper/Popper.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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', From 2652e9baaeb4cb1aa6ec395e68672f5c7cfe1737 Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Mon, 18 Mar 2024 10:02:36 +0700 Subject: [PATCH 2/2] base: use PolymorphicComponent --- packages/mui-base/src/Unstable_Popup/Popup.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 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 ──────────────────────────────┐