-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Bug]: useContext
does not always require destructuring-assignment
#3617
Comments
🤦 Hit submit before completing. Expected behaviorIn the example I would expect that |
@ljharb we were indeed able to upgrade from @uipoptart in your error message, Another thing that I'd also double check is the If this won't help, it would great if you will be able to provide some isolated example of the problem in form of repo or sandbox of some kind. |
Thank you for the quick replies and sorry for the trouble. It is fixed, I just needed to restart VS Code for it to lint with the updated version. |
Is there an existing issue for this?
Description Overview
Hi! This library is awesome!
In latest (7.33.2) I'm getting a linting error for a non-destructured assign from
useContext
. Looking at the React docs for useContext I think the context value might not always require destructuring.Expected Behavior
Here is a simple example based on the React docs for creating a context. In this example mapping over the items returned from
useContext
yields the following linting error:Must use destructuring availableFonts assignment
react/destructuring-assignmenteslint-plugin-react version
v7.31.11
eslint version
v8.28.0
node version
v8.19.2
The text was updated successfully, but these errors were encountered: