We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1a477d commit e016332Copy full SHA for e016332
lib/rules/no-this-state-props.js
@@ -35,12 +35,12 @@ module.exports = {
35
36
function isThisSetStateCallback (node) {
37
if ( node.parent && node.parent.type === 'CallExpression' ) {
38
- var callee = node.parent.callee;
+ var parent = node.parent;
39
var isMatching = (
40
- callee.type === 'MemberExpression' &&
41
- callee.object.type === 'ThisExpression' &&
42
- callee.property.name === 'setState' &&
43
- node.parent.arguments[1] === node
+ isThisSetState(parent) &&
+ parent.arguments &&
+ parent.arguments.length > 1 &&
+ parent.arguments[1] === node
44
)
45
return isMatching
46
}
0 commit comments