material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[core] Fix React 18.3 warnings about spreading keys in the `Autocomplete` component

Open heath-freenome opened this issue 9 months ago • 5 comments

This is related to #40905 only it fixes @mui/material

heath-freenome avatar May 02 '24 19:05 heath-freenome

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

mui-bot avatar May 02 '24 19:05 mui-bot

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.

DiegoAndai avatar May 02 '24 21:05 DiegoAndai

@michaldudak This requires an update on mui-base, but it's only a test file, so I figure it's no problem, right?

DiegoAndai avatar May 02 '24 21:05 DiegoAndai

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!!

heath-freenome avatar May 02 '24 21:05 heath-freenome

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.

michaldudak avatar May 03 '24 07:05 michaldudak

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} />
+            );
           })
         }

oliviertassinari avatar May 08 '24 23:05 oliviertassinari

@ZeeshanTamboli Thanks for all the help on this... When will this fix be released?

heath-freenome avatar May 10 '24 16:05 heath-freenome

@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 avatar May 11 '24 07:05 ZeeshanTamboli

@ZeeshanTamboli v6 alpha release*.

Could someone port this to v5?

oliviertassinari avatar May 11 '24 11:05 oliviertassinari

This is still an issue in the latest Joy-UI release Can this please be addressed!

AdrianMetlenko avatar May 23 '24 00:05 AdrianMetlenko