Skip to content

Commit d0f6675

Browse files
committed
[Fix] first attempt to fix no-access-state-in-setstate
1 parent 6f2ac7a commit d0f6675

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/rules/no-access-state-in-setstate.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
'use strict';
77

8+
const Components = require('../util/Components');
89
const docsUrl = require('../util/docsUrl');
910

1011
// ------------------------------------------------------------------------------
@@ -21,7 +22,7 @@ module.exports = {
2122
}
2223
},
2324

24-
create: function(context) {
25+
create: Components.detect(context => {
2526
function isSetStateCall(node) {
2627
return node.type === 'CallExpression' &&
2728
node.callee.property &&
@@ -168,5 +169,5 @@ module.exports = {
168169
});
169170
}
170171
};
171-
}
172+
})
172173
};

0 commit comments

Comments
 (0)