Skip to content

Commit e25a88c

Browse files
authored
Check node.callee.property existence
1 parent fe3ac1f commit e25a88c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/util/Components.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ function componentRule(rule, context) {
401401
}
402402
const propertyNames = ['forwardRef', 'memo'];
403403
const calleeObject = node.callee.object;
404-
if (calleeObject) {
405-
return arrayIncludes(propertyNames, calleeObject.name) && calleeObject.name === pragma;
404+
if (calleeObject && node.callee.property) {
405+
return arrayIncludes(propertyNames, node.callee.property.name) && calleeObject.name === pragma;
406406
}
407407
return arrayIncludes(propertyNames, node.callee.name) && this.isDestructuredFromPragmaImport(node.callee.name);
408408
},

0 commit comments

Comments
 (0)