From df6c02ddb86c8991bbb217136f4c21302ad2d88e Mon Sep 17 00:00:00 2001 From: sai6855 Date: Fri, 9 Aug 2024 12:48:17 +0530 Subject: [PATCH] fix types --- packages/mui-utils/src/getReactNodeRef/getReactNodeRef.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mui-utils/src/getReactNodeRef/getReactNodeRef.ts b/packages/mui-utils/src/getReactNodeRef/getReactNodeRef.ts index e4cfe22c2a9ee3..2e1a49683b70c7 100644 --- a/packages/mui-utils/src/getReactNodeRef/getReactNodeRef.ts +++ b/packages/mui-utils/src/getReactNodeRef/getReactNodeRef.ts @@ -9,8 +9,8 @@ import * as React from 'react'; */ export default function getReactNodeRef(element: React.ReactNode): React.Ref | null { // 'ref' is passed as prop in React 19, whereas 'ref' is directly attached to children in older versions - return (element as any)!.props.propertyIsEnumerable('ref') - ? (element as any)!.props.ref + return (element as any).props.propertyIsEnumerable('ref') + ? (element as any).props.ref : // @ts-expect-error element.ref is not included in the ReactElement type // We cannot check for it, but isValidElement is true at this point // https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/70189