Skip to content

Commit

Permalink
Update lib/rules/display-name.js
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Harband <ljharb@gmail.com>
  • Loading branch information
TildaDares and ljharb committed Jul 5, 2022
1 parent cc2bdf9 commit 62f3aed
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/rules/display-name.js
Expand Up @@ -65,8 +65,7 @@ module.exports = {
* @returns {Boolean} True if React.forwardRef is nested inside React.memo, false if not.
*/
function isNestedMemo(node) {
const argumentIsCallExpression = node.arguments && node.arguments[0]
? node.arguments[0].type === 'CallExpression' : false;
const argumentIsCallExpression = node.arguments && node.arguments[0] && node.arguments[0].type === 'CallExpression';

return node.type === 'CallExpression'
&& argumentIsCallExpression
Expand Down

0 comments on commit 62f3aed

Please sign in to comment.