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

prop-types doesn't throw when accessing props in bound functions #420

Closed
billyjanitsch opened this issue Jan 30, 2016 · 0 comments
Closed
Labels

Comments

@billyjanitsch
Copy link

const MyComponent = props => (
  <div onClick={() => props.toggle()}>{props.label}</div>
)

There's some debate about the performance of binding functions in render, but, regardless:

The prop-types rule correctly identifies props.label as missing in validation, but fails to identify the same for props.toggle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants