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

[Autocomplete] A prop is passed containing the key #43790

Open
Nefcanto opened this issue Sep 17, 2024 · 1 comment
Open

[Autocomplete] A prop is passed containing the key #43790

Nefcanto opened this issue Sep 17, 2024 · 1 comment
Assignees
Labels
component: autocomplete This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material status: waiting for author Issue with insufficient information

Comments

@Nefcanto
Copy link

Nefcanto commented Sep 17, 2024

Steps to reproduce

Use auto-complete and the latest react. You will see this warning:

Warning: A props object containing a "key" prop is being spread into JSX:
  let props = {key: someKey, tabIndex: ..., role: ..., id: ..., onMouseMove: ..., onClick: ..., onTouchStart: ..., data-option-index: ..., aria-disabled: ..., aria-selected: ..., className: ..., value: ..., children: ...};
  <ForwardRef(MenuItem2) {...props} />
React keys must be passed directly to JSX without using spread:
  let props = {tabIndex: ..., role: ..., id: ..., onMouseMove: ..., onClick: ..., onTouchStart: ..., data-option-index: ..., aria-disabled: ..., aria-selected: ..., className: ..., value: ..., children: ...};
  <ForwardRef(MenuItem2) key={someKey} {...props} />
Autocomplete2@https://client.menutime.local/node_modules/.vite/deps/@mui_material_Autocomplete.js?v=d4467d5a:1549:32
div
withEmotionCache2/<@https://client.menutime.local/node_modules/.vite/deps/chunk-EAUZXVZV.js?v=783f97bd:692:45
FormControl2@https://client.menutime.local/node_modules/.vite/deps/chunk-IWZZKCP6.js?v=783f97bd:114:32

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo
  System:
    OS: Linux 6.8 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
  Binaries:
    Node: 20.17.0 - /usr/local/bin/node
    npm: 10.8.3 - /usr/local/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: Not Found
  npmPackages:
    @emotion/react: ^11.13.3 => 11.13.3 
    @emotion/styled: ^11.13.0 => 11.13.0 
    @mui/base:  5.0.0-beta.40 
    @mui/core-downloads-tracker:  6.1.0 
    @mui/icons-material: ^6.1.0 => 6.1.0 
    @mui/lab: ^5.0.0-alpha.101 => 5.0.0-alpha.173 
    @mui/material: ^6.1.0 => 6.1.0 
    @mui/private-theming:  5.16.6 
    @mui/styled-engine:  5.16.6 
    @mui/system:  5.16.7 
    @mui/types:  7.2.16 
    @mui/utils:  5.16.6 
    @mui/x-date-pickers: ^7.16.0 => 7.16.0 
    @mui/x-internals:  7.16.0 
    @types/react: ^18.3.5 => 18.3.5 
    react: ^18.3.1 => 18.3.1 
    react-dom: ^18.3.1 => 18.3.1 

I'm using FireFox

Search keywords: props key

@Nefcanto Nefcanto added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 17, 2024
@aarongarciah aarongarciah self-assigned this Sep 17, 2024
@aarongarciah
Copy link
Member

@Nefcanto I can't reproduce the issue. Can you share a reproduction? Looking at the error message, I'm not sure the error comes from Autocomplete.

@aarongarciah aarongarciah added status: waiting for author Issue with insufficient information component: autocomplete This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 17, 2024
@aarongarciah aarongarciah changed the title A prop is passed containing the key [Autocomplete] A prop is passed containing the key Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

2 participants