diff --git a/lib/rules/jsx-max-depth.js b/lib/rules/jsx-max-depth.js index 12206a4081..12625fa704 100644 --- a/lib/rules/jsx-max-depth.js +++ b/lib/rules/jsx-max-depth.js @@ -91,7 +91,7 @@ module.exports = { function findJSXElementOrFragment(startNode, name, previousReferences) { function find(refs, prevRefs) { for (let i = refs.length - 1; i >= 0; i--) { - if (has(refs[i], 'writeExpr')) { + if (typeof refs[i].writeExpr !== 'undefined') { const writeExpr = refs[i].writeExpr; return (jsxUtil.isJSX(writeExpr)