From 9be7252b50bec09c5215a50900bb75c9f44c01e7 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Tue, 24 Oct 2023 12:38:18 +0530 Subject: [PATCH] chore(react): fix autocomplete component prop type issue --- .../src/components/Autocomplete/Autocomplete.tsx | 16 ++++++++-------- .../react/src/components/Autocomplete/index.ts | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/react/src/components/Autocomplete/Autocomplete.tsx b/packages/react/src/components/Autocomplete/Autocomplete.tsx index 5191997b..c2b60f94 100644 --- a/packages/react/src/components/Autocomplete/Autocomplete.tsx +++ b/packages/react/src/components/Autocomplete/Autocomplete.tsx @@ -27,16 +27,16 @@ export type AutocompleteProps = MuiAutocompleteProps>> & WithWrapperProps = - forwardRef( - (props: AutocompleteProps>, ref: MutableRefObject): ReactElement => { - const {className, ...rest} = props; +// `any` is used as the generic type for the props because the generic type is not used in the component. +const Autocomplete: ForwardRefExoticComponent> & WithWrapperProps = forwardRef( + (props: AutocompleteProps, ref: MutableRefObject): ReactElement => { + const {className, ...rest} = props; - const classes: string = clsx('oxygen-autocomplete', className); + const classes: string = clsx('oxygen-autocomplete', className); - return ; - }, - ) as ForwardRefExoticComponent>> & WithWrapperProps; + return ; + }, +) as ForwardRefExoticComponent> & WithWrapperProps; Autocomplete.displayName = composeComponentDisplayName(COMPONENT_NAME); Autocomplete.muiName = COMPONENT_NAME; diff --git a/packages/react/src/components/Autocomplete/index.ts b/packages/react/src/components/Autocomplete/index.ts index 67d7bc98..19b10191 100644 --- a/packages/react/src/components/Autocomplete/index.ts +++ b/packages/react/src/components/Autocomplete/index.ts @@ -18,3 +18,4 @@ export {default} from './Autocomplete'; export type {AutocompleteProps} from './Autocomplete'; +export type {AutocompleteRenderGetTagProps, AutocompleteRenderInputParams} from '@mui/material/Autocomplete';