-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Error: 'is missing in props validation' after update of ESLint to v5.4.0 #1957
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
Comments
That's confusing; the class field example is actually wildly incorrect - propTypes needs to be We have almost your exact example in our test cases, so it seems like something else is going on. Can you share your full eslint config? |
Mh, I have this example from your rules documentation for prop-types: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md propTypes works even if it's not defined as Here is our ESLint configuration:
|
React doesn't have a v16.3.14, btw, it only goes up to v16.3.2 before v16.4. However this, just like This should definitely work. cc @alexzherdev any ideas? |
Ok, I'm a little bit confused - is this issue only about the fact that |
Yes, it was the latter. But wie fixed it by ourselves. The problem was that we exported the class like
After we changed this to
It works like a charm. I don't understand why the first version causes 'is missing in props validation' errors. But we wanted to update to the other syntax anyway. |
By now we validated our props like this:
But after an update of ESLint from v4.19.1 to v5.4.0 we always get the 'is missing in props validation' error.
If we put the validation inside of the class it works perfectly like this:
Why is that the case? We couldn't find anything in the changelog according to this.
The text was updated successfully, but these errors were encountered: