From adc4fc4b8fe8416711bae20cd9310c72109bbe83 Mon Sep 17 00:00:00 2001 From: Brion Date: Mon, 21 Oct 2024 17:44:20 +0530 Subject: [PATCH] fix(react): type issue in `Dialog` with `OverridableComponent` --- packages/react/src/components/Dialog/Dialog.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/react/src/components/Dialog/Dialog.tsx b/packages/react/src/components/Dialog/Dialog.tsx index 1dc5f4cf..08f69e76 100644 --- a/packages/react/src/components/Dialog/Dialog.tsx +++ b/packages/react/src/components/Dialog/Dialog.tsx @@ -18,10 +18,8 @@ import MuiDialog from '@mui/material/Dialog'; import type {DialogProps as MuiDialogProps} from '@mui/material/Dialog'; -import type {ModalTypeMap} from '@mui/material/Modal'; -import {OverridableComponent} from '@mui/material/OverridableComponent'; import clsx from 'clsx'; -import {forwardRef} from 'react'; +import {forwardRef, ForwardRefExoticComponent} from 'react'; import type {ElementType, ReactElement, Ref} from 'react'; export type DialogProps = { @@ -46,7 +44,7 @@ export type DialogProps = { * * @remarks * - ✔️ Props of the [Modal](https://mui.com/material-ui/api/modal/) component are also available. - * - ✅ `component` prop is supported. + * - FIXME: ⚠️ `component` prop is temporarily not supported due to https://github.com/wso2/oxygen-ui/issues/283 * - ✅ The `ref` is forwarded to the root element. * * @template C - The type of the component. @@ -54,11 +52,11 @@ export type DialogProps = { * @param ref - The ref to be forwarded to the MuiDialog component. * @returns The rendered Dialog component. */ -const Dialog: OverridableComponent> = forwardRef( +const Dialog: ForwardRefExoticComponent = forwardRef( ( {className, ...rest}: DialogProps, ref: Ref, ): ReactElement => , -) as OverridableComponent>; +) as ForwardRefExoticComponent; export default Dialog;