We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eae30c4 commit 227a3e0Copy full SHA for 227a3e0
packages/mui-utils/src/getElementRef/getElementRef.ts
@@ -10,9 +10,10 @@ export default function getElementRef(element: React.ReactElement<any>): React.R
10
if (!element || !React.isValidElement(element)) {
11
return null;
12
}
13
+
14
// 'ref' is passed as prop in React 19, whereas 'ref' is directly attached to children in older versions
15
return (element.props as any).propertyIsEnumerable('ref')
16
? (element.props as any).ref
- : // @ts-expect-error child.ref is incompatible with types prior to React 19
17
+ : // @ts-expect-error element.ref is not included with ReactElement type, even though it exists
18
element.ref;
19
0 commit comments