Skip to content

Commit 7928c33

Browse files
committed
small js style refactor
1 parent ab9b2a9 commit 7928c33

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/isStatelessComponent.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ function isReturningJSXElement(path) {
2121
visited = true;
2222
} else if (argument.node.type === 'CallExpression') {
2323

24-
const node = argument.get('callee').node;
24+
const { node } = argument.get('callee');
2525
if (node.object.name === 'React' && node.property.name === 'createElement') {
2626
visited = true;
2727
}
2828

29-
const name = argument.get('callee').node.name;
30-
const binding = path.scope.getBinding(name);
29+
const binding = path.scope.getBinding(node.name);
3130

3231
if (!binding) {
3332
return;

0 commit comments

Comments
 (0)