-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[joy-ui][Autocomplete] Console error in Next.js about key prop being spread into JSX #40905
Comments
Looks like the same as #39795 (Illustrate why we should move toward implementing Joy UI and Material UI as themes) |
I am also getting this error with the basic implementation of autocomplete. *edit: on a NextJS app using React 18 |
In my case, the problem started to show up when I updated our React dependency to v18.3. And this is the change which triggered the error (Warn when spreading I am using Next v14.2.3 and this is the exact console error I got:
After having tried out some strategies to solve the problem I am now convinced there is nothing I can do on my side to solve the problem. What do you think? |
This is also happening in @mui/material Autocomplete component once upgrading to React 18.3.
It looks like getTagProp needs to extract the key instead of spreading it (https://github.com/mui/material-ui/blob/next/packages/mui-base/src/useAutocomplete/useAutocomplete.js#L1134)
|
Let's aggregate all of those. Moving to #39833. |
Steps to reproduce
Link to live example: https://mui.com/joy-ui/react-autocomplete
Steps:
using nextjs, open any autocomplete element with options, and you will see the console error complaining about spreading the key. "Warning: A props object containing a "key" prop is being spread into JSX:"
This issues appears to have been recently fixed with the material-ui package #39474, but not yet with the joy-ui package.
Current behavior
Expected behavior
No console warnings
Context
No response
Your environment
Search keywords: joy-ui nextjs warning key
The text was updated successfully, but these errors were encountered: