Skip to content

crashes on stateless react class #2179

Closed
@spudly

Description

@spudly

I'm getting this error:

TypeError: Cannot read property 'type' of undefined
    at resolveSuperParameterPropsType (node_modules/eslint-plugin-react/lib/util/propTypes.js:615:20)
    at Object.ClassDeclaration (node_modules/eslint-plugin-react/lib/util/propTypes.js:651:39)
    at updatedRuleInstructions.(anonymous function) (node_modules/eslint-plugin-react/lib/util/Components.js:748:43)
    at listeners.(anonymous function).forEach.listener (node_modules/eslint/lib/util/safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (node_modules/eslint/lib/util/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (node_modules/eslint/lib/util/node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (node_modules/eslint/lib/util/node-event-generator.js:280:22)
    at NodeEventGenerator.enterNode (node_modules/eslint/lib/util/node-event-generator.js:294:14)
    at CodePathAnalyzer.enterNode (node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:632:23)

It appears to be caused by a react class that has no state. It crashes for this code:

class MyClass extends React.Component<Props> {}

...but does not crash if you add a state annotation:

class MyClass extends React.Component<Props, State> {}

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