Skip to content

Incorrect prop validation when using this.props in constructor #259

Closed
@gaearon

Description

This is exactly like #254, but when using this.props instead of props argument in constructor.

class TodoTextInput extends Component {
  constructor(props, context) {
    super(props, context);
    this.state = { text: this.props.text };
  }
}
TodoTextInput.propTypes = {
  text: PropTypes.string.isRequired
}

will give you 'props' is missing in props validation for TodoTextInput.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions