Skip to content

no-unused-state: Cannot read property 'add' of null #2096

Closed
@dylang

Description

@dylang

We have hundreds of files with JSX so I'm not sure which one is leading to this exception.

  • 7.11.1: No error.
  • v7.12.0: The following error.
TypeError: Cannot read property 'add' of null
    at Object.CallExpression (./eslint-plugin-react/lib/rules/no-unused-state.js:269:31)
    at updatedRuleInstructions.(anonymous function) (./eslint-plugin-react/lib/util/Components.js:754:75)
    at listeners.(anonymous function).forEach.listener (./eslint/lib/util/safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (./eslint/lib/util/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (./eslint/lib/util/node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (./eslint/lib/util/node-event-generator.js:280:22)
    at NodeEventGenerator.enterNode (./eslint/lib/util/node-event-generator.js:294:14)
    at CodePathAnalyzer.enterNode (./eslint/lib/code-path-analysis/code-path-analyzer.js:632:23)
    at nodeQueue.forEach.traversalInfo (./eslint/lib/linter.js:750:28)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions