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
'foo' is missing in props validation (react/prop-types) #1447
Comments
I am having this issue in async functions method1 = async () =>{
const { propNotInPropTypes } = this.props
} This does not show warning |
@haikyuu that is a separate issue, but related to the same thing: the rule isn’t looking for those patterns. Could you file yours separately? |
The issue here is that |
I'm not sure about the internals; but |
Hmm, on further look I wasn't completely correct. export default Post = () => ... isn't the correct way to do default exports? There should be an expression, which in this case is an assignment expression, but Post doesn't get declared (no var/let/const). I think that explains why eslint-escope doesn't record it as a variable. So is this even valid ES2015, assigning to an undeclared variable (assuming strict mode in a module)? |
Good catch - I don't think it is. @armenzg how were you able to avoid a syntax error here? I'm going to close this, but will reopen if this is indeed valid. |
FWIW (not sure if this is a good indicator of the real situation in this case) Babel transpiles this to exports.default = Post = function Post() {}; and then Post = function Post() {}; is a runtime ReferenceError in strict mode. |
Let's close it. |
Thanks for looking into it! |
I was having trouble with this ('post' is missing in props validation (react/prop-types)):
but this did not have anymore issues:
And I believe this information could be useful:
The text was updated successfully, but these errors were encountered: