Skip to content

Commit df6c02d

Browse files
committed
fix types
1 parent 9767107 commit df6c02d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/mui-utils/src/getReactNodeRef/getReactNodeRef.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import * as React from 'react';
99
*/
1010
export default function getReactNodeRef(element: React.ReactNode): React.Ref<any> | null {
1111
// 'ref' is passed as prop in React 19, whereas 'ref' is directly attached to children in older versions
12-
return (element as any)!.props.propertyIsEnumerable('ref')
13-
? (element as any)!.props.ref
12+
return (element as any).props.propertyIsEnumerable('ref')
13+
? (element as any).props.ref
1414
: // @ts-expect-error element.ref is not included in the ReactElement type
1515
// We cannot check for it, but isValidElement is true at this point
1616
// https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/70189

0 commit comments

Comments
 (0)