Skip to content

Commit 294e51f

Browse files
committed
fix: class component detect
1 parent dad5c35 commit 294e51f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ref.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ export function supportRef(nodeOrComponent: any): boolean {
3030
return false;
3131
}
3232

33-
// Function component
34-
if (typeof nodeOrComponent === 'function' && !nodeOrComponent.prototype.render) {
33+
// Class component
34+
if (
35+
typeof nodeOrComponent === 'function' &&
36+
nodeOrComponent.prototype &&
37+
!nodeOrComponent.prototype.render
38+
) {
3539
return false;
3640
}
3741

0 commit comments

Comments
 (0)