Skip to content

Commit 99d8344

Browse files
authored
fix: ref could be passed as a prop in 19.x
close ant-design/ant-design#52282
1 parent 6c00fea commit 99d8344

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const supportRef = (nodeOrComponent: any): boolean => {
4545
// React 19 no need `forwardRef` anymore. So just pass if is a React element.
4646
if (
4747
isReactElement(nodeOrComponent) &&
48-
(nodeOrComponent as any).props.propertyIsEnumerable('ref')
48+
React.version.startsWith('19.')
4949
) {
5050
return true;
5151
}

0 commit comments

Comments
 (0)