-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
'no-unused-prop-types' error with destructured props #2433
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
I would expect an error here because |
I was wondering the same, but haven't seen the issue before, so I was unsure. The exact error is this:
The area of code where the error is occurring is doing the following, though this is only one example of several.
If the solution is to make a more specific |
As an update, I tried the below and am still receiving an error: Error
This is our
As well as other modules that we're using. The application itself was built with CRA:
|
Correct, this was a bug fix. These things should always have errored, and we fixed the bug of it not erroring. |
Okay, perfect! That's good to know. Given my above comments with the more specific shape that is still erroring, could you suggest or point me toward a possible solution? |
The case in example in #2433 (comment) is fixed by #2428. Can you confirm by |
@golopot Thanks for providing the MR that addressed this false positive. I'm happy to adjust accordingly to be more specific, but the solution I posted in this comment still didn't remedy the error. Is there a way in which you would suggest fixing this error? I'm also not sure what I would be confirming with |
Since the pr is merged, and npm i that will install the master version of this plugin, and if your issue if solved by the pr, the error should disappear. |
Ah, perfect. I can confirm that the error is gone! Thanks for the persistence and follow-up. Any idea of when this will be released if it isn't already? |
Closed by #2328. It will be released as soon as I can make time to do it. |
@ljharb, perfect, I'll watch for releases. Thank you! |
I looked through at a few issues but wasn't able to find something that matched this exactly. If there is a duplicate issue, a reference would be great and this one can be closed.
Currently, I'm running into
no-unused-prop-types
for any props that are not accessed directly, but rather have other properties destructed from them. I'm currently using"eslint-plugin-react": "^7.15.1"
.This wasn't happening as of yesterday, when I was using
"eslint-plugin-react": "^7.12.4"
.If any other details are needed, please let me know!
Example
The text was updated successfully, but these errors were encountered: