-
-
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
jsx-key Missing "key" prop for element in array
when there is no array/iteration
#3215
Comments
I can confirm I'm seeing this with |
Same, does not look right. Several hundred errors. Some lines trigger this error multiple times. |
I also encountered the same problem, it can be solved by downgrading the version |
Wondering why there is no release log about 7.29.0 on the releases page. 🤔 |
I do use keys, but of course only for the outmost element. This new rule requires a key for every child element, too. I think this is an error. In the following example the rule throws an error that the div element doesn't have a key attribute. That's wrong.
|
True!, |
Fixes #34797. Context: https://github.com/yannickcr/eslint-plugin-react was released in 7.29.0 2h ago and breaks the linting of a default create-next-app. See: jsx-eslint/eslint-plugin-react#3215 This PR locks the version to the latest working one.
I confirm same issue, I'm using vite with React TypeScript |
Facing the same with React. |
Just installed a new project using |
Avoided installing [email protected]. A bug in this version resulted in hundreds of false positives. jsx-eslint/eslint-plugin-react#3215
We are currently getting the same error in bitbucket pipelines. When installed with yarn, the package eslint-plugin-react goes up to 7.29. It gives error like this. When we do npm install, it does not give an error. Because it stays at 7.28. |
Avoided installing [email protected]. A bug in this version resulted in hundreds of false positives. jsx-eslint/eslint-plugin-react#3215
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Hey, I tried to find eslint-config-next repositories, because I have the same bug. I updated this and next to latest stable and canary version, but it didn't help. What do you know something about this? |
This comment was marked as resolved.
This comment was marked as resolved.
@jukialen please file a new issue if you're still having problems. |
* Update eslint-plugin-react to latest version There is currently a bug in eslint-plugin-react jsx-eslint/eslint-plugin-react#3215. The bug was just fixed in 7.29.1 * update lockfile Co-authored-by: JJ Kasper <[email protected]>
Just a quick heads up to anyone still experiencing this after upgrading. You may have to delete your .next folder after upgrading to 7.29.1 |
I only add that if someone has only next and eslint-config-next in a package.json, and updating next canary version won't help, it schould delete .next folder, reopen a project and install eslint-plugin-react in 7.29.1 (in this order). It helped me so maybe it'll help someone. |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
The upgrade to 7.29.0 had [a bug](jsx-eslint/eslint-plugin-react#3215) that flagged a lot of false positives. Upgrading to 7.29.2 to pull in the fix.
The upgrade to 7.29.0 had [a bug](jsx-eslint/eslint-plugin-react#3215) that flagged a lot of false positives. Upgrading to 7.29.2 to pull in the fix.
This comment was marked as resolved.
This comment was marked as resolved.
I know it's a bit late, as many of you found the solution probably but I want to add my experience,i was facing the same problem but then I used React fragment (<></>) and the error was removed. |
Hello,
I just upgraded eslint-plugin-react from 7.28.0 to 7.29.0
The result is I now get a
Missing "key" prop for element in array
error on all my components, regardless of them having an array/map or anything that would require a key prop.Before upgrade, the app worked fine, the key prop was already where it should be, on all arrays/lists.
Example of error:
=> no array on line 17 char 7, just calling a component.
The text was updated successfully, but these errors were encountered: