Skip to content
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

eslint-plugin-react: "version": "7.29.0" - Missing "key" prop for element in array #7085

Closed
7 tasks done
cojoclaudiu opened this issue Feb 25, 2022 · 3 comments
Closed
7 tasks done

Comments

@cojoclaudiu
Copy link

Describe the bug

After updating eslint-plugin-react from "version": "7.28.0" to "version": "7.29.0" I got this error error for all my files.

Missing "key" prop for element in array react/jsx-key

I'm using as a template React JS with Typescript.

jsx-eslint/eslint-plugin-react#320

Reproduction

error Missing "key" prop for element in array react/jsx-key

System Info

System:
    OS: macOS 12.2.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 785.86 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.2 - ~/.volta/tools/image/node/16.13.2/bin/node
    Yarn: 1.22.17 - ~/.volta/tools/image/yarn/1.22.17/bin/yarn
    npm: 8.1.2 - ~/.volta/tools/image/node/16.13.2/bin/npm
    Watchman: 2021.11.15.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 98.0.4758.109
    Firefox: 97.0.1
    Firefox Developer Edition: 96.0
    Safari: 15.3
  npmPackages:
    @vitejs/plugin-react: ^1.0.7 => 1.2.0 
    vite: ^2.7.2 => 2.8.4

Used Package Manager

npm

Logs

No response

Validations

@jsgv
Copy link

jsgv commented Feb 25, 2022

I am also getting this error for almost all my components even when key is used correctly.

Started happening with eslint-plugin-react: 7.29.0.

Pinning the version to 7.28.0 through overrides solves the false positive errors.

Reference: jsx-eslint/eslint-plugin-react#3215

@sodatea
Copy link
Member

sodatea commented Feb 25, 2022

That's from eslint-plugin-react, not from Vite.

Reference: jsx-eslint/eslint-plugin-react#3215

@sodatea sodatea closed this as completed Feb 25, 2022
@cojoclaudiu
Copy link
Author

Now the problem it's fixed, update eslint-plugin-react to the last version 7.29.2

@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants