Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gaearon opened this issue Oct 19, 2015 · 3 comments
Closed

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

gaearon opened this issue Oct 19, 2015 · 3 comments

Comments

@gaearon
Copy link
Collaborator

gaearon commented Oct 19, 2015

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.

@gaearon
Copy link
Collaborator Author

gaearon commented Oct 19, 2015

I added failing test cases in #260.

@yannickcr
Copy link
Member

Thanks for the test case, I'll have a look.

@gaearon
Copy link
Collaborator Author

gaearon commented Oct 19, 2015

Thanks for a quick fix!

ericsoco pushed a commit to americanpanorama/panorama that referenced this issue Oct 20, 2015
…/ invalid rules

Fix all lint warnings except the invalid one (see: jsx-eslint/eslint-plugin-react#259)
Refactor Legend to accept props directly, via spread operator, instead of packing into a `data` object
Fix name of choropleth example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants