Skip to content

Conversation

@DiegoAndai
Copy link
Member

@DiegoAndai DiegoAndai commented Aug 5, 2024

Part of: #42824

I couldn't find a reason in the React 19 upgrade guide for why this change was necessary. What I understand is that because the array is being defined on every render, it's not stable. Users would have to change this as well when upgrading to React 19.

@DiegoAndai DiegoAndai added package: material-ui scope: autocomplete Changes related to the autocomplete. This includes ComboBox. labels Aug 5, 2024
@DiegoAndai DiegoAndai requested a review from aarongarciah August 5, 2024 19:14
@DiegoAndai DiegoAndai self-assigned this Aug 5, 2024
@DiegoAndai DiegoAndai changed the title [material-ui][Autocomplete] Fix default value for multiple mode getting redefined [material-ui][Autocomplete] Fix default value for multiple mode getting redefined with React 19 Aug 5, 2024
@DiegoAndai DiegoAndai added the integration: react About improving React support. label Aug 5, 2024
@mui-bot
Copy link

mui-bot commented Aug 5, 2024

Netlify deploy preview

https://deploy-preview-43189--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 7e14306

Copy link
Member

@aarongarciah aarongarciah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@DiegoAndai DiegoAndai requested a review from michaldudak August 5, 2024 21:24
@DiegoAndai
Copy link
Member Author

@michaldudak does this change make sense to you?

Without these, the "controlled to uncontrolled" error throws here:

https://github.com/mui/material-ui/blob/next/packages/mui-utils/src/useControlled/useControlled.js#L38

Just double checking if there's no better solution here.

Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense for sure 👍. I'm just not aware why this started to be a problem only now with React 19.

@DiegoAndai
Copy link
Member Author

I'm just not aware why this started to be a problem only now with React 19.

I was wondering the same 😅

Thanks fro reviewing!

@DiegoAndai DiegoAndai merged commit eba9593 into mui:next Aug 6, 2024
@DiegoAndai DiegoAndai deleted the react-19-autocomplete-default-multiple branch August 6, 2024 12:12
DiegoAndai added a commit to DiegoAndai/material-ui that referenced this pull request Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration: react About improving React support. scope: autocomplete Changes related to the autocomplete. This includes ComboBox.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants