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 abe26e2 commit b84c85dCopy full SHA for b84c85d
packages/mui-utils/src/getReactElementRef/getReactElementRef.ts
@@ -10,10 +10,8 @@ import * as React from 'react';
10
export default function getReactElementRef(
11
element: React.ReactElement,
12
): React.Ref<any> | null | undefined {
13
- const reactMajorVersion = parseInt(React.version.split('.')[0], 10);
14
-
15
// 'ref' is passed as prop in React 19, whereas 'ref' is directly attached to children in older versions
16
- if (reactMajorVersion >= 19) {
+ if (parseInt(React.version, 10) >= 19) {
17
return element.props?.ref;
18
}
19
// @ts-expect-error element.ref is not included in the ReactElement type
0 commit comments