Skip to content

Commit 62f3aed

Browse files
TildaDaresljharb
andauthored
Update lib/rules/display-name.js
Co-authored-by: Jordan Harband <[email protected]>
1 parent cc2bdf9 commit 62f3aed

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/rules/display-name.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ module.exports = {
6565
* @returns {Boolean} True if React.forwardRef is nested inside React.memo, false if not.
6666
*/
6767
function isNestedMemo(node) {
68-
const argumentIsCallExpression = node.arguments && node.arguments[0]
69-
? node.arguments[0].type === 'CallExpression' : false;
68+
const argumentIsCallExpression = node.arguments && node.arguments[0] && node.arguments[0].type === 'CallExpression';
7069

7170
return node.type === 'CallExpression'
7271
&& argumentIsCallExpression

0 commit comments

Comments
 (0)