Skip to content

Conversation

@nicegamer7
Copy link
Contributor

This PR fixes some inconsistencies with the typings of some of the MUI Material components, which led to type errors when the React children type was augmented. There may be more of these inconsistencies that I missed.

react-i18next is an example package that augments React's types, allowing objects to be passed as children. Without these changes, several react-i18next users were experiencing type-errors (i18next/react-i18next#1543 (comment)) related to the Autocomplete component.

@mui-bot
Copy link

mui-bot commented Sep 8, 2023

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 491c0c5

@nicegamer7
Copy link
Contributor Author

Hey, just wanted to check in on this.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 5, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 21, 2023
@ZeeshanTamboli ZeeshanTamboli added typescript scope: autocomplete Changes related to the autocomplete. This includes ComboBox. labels Dec 21, 2023
@ZeeshanTamboli ZeeshanTamboli changed the title Use exact children type to allow React type augmentation [material-ui][TextField] Use exact children type to allow React type augmentation Dec 21, 2023
@ZeeshanTamboli ZeeshanTamboli added scope: text field Changes related to the text field. component: FormControl The React component. labels Dec 21, 2023
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

This looks good. Let's remove the test though. We can do this change to allow React type augmentation.

@ZeeshanTamboli ZeeshanTamboli changed the title [material-ui][TextField] Use exact children type to allow React type augmentation [material-ui][TextField][FormLabel][InputLabel][FormControl] Use exact children type to allow React type augmentation Dec 21, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jan 3, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jan 4, 2024
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

@nicegamer7 I have applied the expected changes by removing the test. Looks good now, thanks!

@ZeeshanTamboli ZeeshanTamboli changed the title [material-ui][TextField][FormLabel][InputLabel][FormControl] Use exact children type to allow React type augmentation [material-ui][TextField][FormLabel][InputLabel][FormControl] Use exact children type to allow React children type augmentation Jan 4, 2024
@ZeeshanTamboli ZeeshanTamboli merged commit cb76f8f into mui:master Jan 4, 2024
@nicegamer7
Copy link
Contributor Author

Thanks for taking care of this!

mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Jan 9, 2024
…t children type to allow React children type augmentation (mui#38872)

Co-authored-by: ZeeshanTamboli <zeeshan.tamboli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: FormControl The React component. scope: autocomplete Changes related to the autocomplete. This includes ComboBox. scope: text field Changes related to the text field. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants