You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, when I have an async function, whether class method or a function by itself, and I destructure this.props, I am not warned about the props, even if they aren't in the prop-types. If I do have those props inside prop-types and I have the rule about unused prop-types on,
I found that if I use a destructured prop I stop getting warned about that prop being unused. This indicates that the bug is with the using, but not with the un-using, at least in classes.
This only applies to class methods, though. I never get warned about props in an async function declaration/statement, whether undeclared or unused, whether I use them or not, whether I declare them or not, or neither, or both. Also, this applies whether or not I'm destructuring. Basically, async functions seem un-implemented.
I tried to be as simple as possible. I added as few ESLint rules & plugins as I needed to illustrate the issue, and I didn't even add babel, though I did add babel-eslint. I also tried to be short & succinct with my function/variable/class names, though I may have been a little too cute. If you're still confused, please tell me.
The text was updated successfully, but these errors were encountered:
I added a GitHub repo illustrating the bug: trisys3/prop-types-async-issue.
Basically, when I have an async function, whether class method or a function by itself, and I destructure
this.props
, I am not warned about the props, even if they aren't in the prop-types. If I do have those props inside prop-types and I have the rule about unused prop-types on,I found that if I use a destructured prop I stop getting warned about that prop being unused. This indicates that the bug is with the using, but not with the un-using, at least in classes.
This only applies to class methods, though. I never get warned about props in an async function declaration/statement, whether undeclared or unused, whether I use them or not, whether I declare them or not, or neither, or both. Also, this applies whether or not I'm destructuring. Basically, async functions seem un-implemented.
I tried to be as simple as possible. I added as few ESLint rules & plugins as I needed to illustrate the issue, and I didn't even add babel, though I did add babel-eslint. I also tried to be short & succinct with my function/variable/class names, though I may have been a little too cute. If you're still confused, please tell me.
The text was updated successfully, but these errors were encountered: