-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[material-ui][Autocomplete] renderOption
props is missing the key
prop in its definition.
#42161
Labels
duplicate
This issue or pull request already exists
Comments
mbiggs-gresham
added
the
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
label
May 8, 2024
mbiggs-gresham
changed the title
Autocomplete
Autocomplete May 8, 2024
renderOption
props is missing the key
prop.renderOption
props is missing the key
prop in its definition.
zannager
added
the
component: autocomplete
This is the name of the generic UI component, not the React module!
label
May 8, 2024
Let's aggregate all of those. Closing for #39833 |
oliviertassinari
added
duplicate
This issue or pull request already exists
and removed
bug 🐛
Something doesn't work
component: autocomplete
This is the name of the generic UI component, not the React module!
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
labels
May 8, 2024
DiegoAndai
changed the title
Autocomplete
[material-ui][Autocomplete] Jun 18, 2024
renderOption
props is missing the key
prop in its definition.renderOption
props is missing the key
prop in its definition.
DiegoAndai
added
bug 🐛
Something doesn't work
typescript
ready to take
Help wanted. Guidance available. There is a high chance the change will be accepted
and removed
duplicate
This issue or pull request already exists
labels
Jun 18, 2024
DiegoAndai
added
duplicate
This issue or pull request already exists
and removed
bug 🐛
Something doesn't work
typescript
ready to take
Help wanted. Guidance available. There is a high chance the change will be accepted
labels
Jun 18, 2024
Sorry for the reopening-closing mess 😅 I got confused, see: #39833 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Current behavior
The
props
object passed to therenderOption
of an Autocomplete is of typeReact.HTMLAttributes<HTMLLIElement>
and does not specify akey
prop. Previously we could spread the props directly on to a child list item, however in react 18.3.0 onwards (facebook/react#25697) it is now a warning that you must explicitly specify thekey
prop. eg:Because the prop is missing we have to cast the
props
object to keep typescript happy. eg:const { key, ...rest } = props as React.HTMLAttributes<HTMLLIElement> & { key: string };
Expected behavior
We should not have to cast the
props
.Context
No response
Your environment
npx @mui/envinfo
Search keywords: AutoComplete renderOption key
The text was updated successfully, but these errors were encountered: