Skip to content

React.Component props doesn't allow explicit 'any' type when {"noImplicitAny": true} #10294

@bezreyhan

Description

@bezreyhan

TypeScript Version: 2.0

relevant config: {"noImplicitAny": true}

Code

class VerticalNav extends React.Component <any, IVerticalNavState> {
  constructor(props) {
    super(props);
    this.state = {closed: false}
  }
}

Expected behavior:
No type errors thrown.

Actual behavior:
error TS7006: Parameter 'props' implicitly has an 'any' type.

This error should not be thrown because props has explicitly been set to type: any;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions