material-ui
material-ui copied to clipboard
[core] Fix React 18.3 warnings about spreading keys in the `Autocomplete` component
This is related to #40905 only it fixes @mui/material
- [x] I have followed (at least) the PR section of the contributing guide.
Netlify deploy preview
https://deploy-preview-42099--material-ui.netlify.app/
Bundle size report
Details of bundle changes (Toolpad) Details of bundle changes
Generated by :no_entry_sign: dangerJS against ceeb9fda3106cdc199011309f861fa54ef5cd3ed
Hey @heath-freenome, thanks for working on this! We need this for https://github.com/mui/material-ui/pull/42047, but it's missing some fixes. I've updated the PR with the missing cases. Adding @ZeeshanTamboli as a reviewer.
@michaldudak This requires an update on mui-base
, but it's only a test file, so I figure it's no problem, right?
Hey @heath-freenome, thanks for working on this! We need this for #42047, but it's missing some fixes. I've updated the PR with the missing cases. Adding @ZeeshanTamboli as a reviewer.
@DiegoAndai Thanks for fixing that!!
This requires an update on mui-base, but it's only a test file, so I figure it's no problem, right?
No problem at all! I'll port this update to the Base UI repo as well.
What I can read on this:
- I would expect that we need to cherry-pick this on master since it's a regression relative to React stable.
- I have grouped all the related issues under #39833.
- I have opened #42168 to prove the point that there is a lot to do
- I did a quick dive into this: https://github.com/mui/material-ui/issues/39833#issuecomment-2101675127.
- It feels like we will need to change the API of the Autocomplete. Seeing this diff feels poor DX
value.map((option, index) => (
- <Chip variant="outlined" label={option} {...getTagProps({ index })} />
+ const { key, ...tagProps } = getTagProps({ index });
+ return (
+ <Chip variant="outlined" label={option} key={key} {...tagProps} />
+ );
})
}
@ZeeshanTamboli Thanks for all the help on this... When will this fix be released?
@heath-freenome Regarding for the v6 alpha release, it's scheduled for next week. However, I'm unsure about release in v5, as it wasn't cherry-picked to the master branch for v5.
@ZeeshanTamboli v6 alpha release*.
Could someone port this to v5?
This is still an issue in the latest Joy-UI release Can this please be addressed!