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 <[email protected]>
  • Loading branch information
TildaDares and ljharb authored 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
Original file line number Diff line number Diff line change
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.