Skip to content
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

[material-ui][Select] Fix muiName property TypeScript error #41726

Merged

Conversation

EyaOuenniche
Copy link
Contributor

@EyaOuenniche EyaOuenniche commented Mar 31, 2024

Summary
This pull request addresses a TypeScript error when assigning muiName to a custom component based on Material-UI's Select. It ensures the muiName property is properly recognized in the type definition, facilitating successful compilation.

Fixes #41707

@mui-bot
Copy link

mui-bot commented Mar 31, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 594b2d6

@danilo-leal danilo-leal changed the title Fix muiName Property TypeScript Error in Custom Select Component [material-ui][Select] Fix muiName property TypeScript error Apr 1, 2024
@danilo-leal danilo-leal added component: select This is the name of the generic UI component, not the React module! typescript package: material-ui Specific to @mui/material labels Apr 1, 2024
@EyaOuenniche EyaOuenniche force-pushed the add-muiname-to-select-component branch from c262f17 to d4da7e3 Compare April 2, 2024 09:13
@EyaOuenniche EyaOuenniche force-pushed the add-muiname-to-select-component branch from d4da7e3 to a0d7a86 Compare April 2, 2024 10:16
@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work regression A bug, but worse labels Apr 6, 2024
@@ -151,23 +151,26 @@ export interface BaseSelectProps<Value = unknown>
variant?: SelectVariants;
}

export interface FilledSelectProps extends Omit<FilledInputProps, 'value' | 'onChange'> {
export interface FilledSelectProps
extends Omit<FilledInputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps'> {
Copy link
Member

Choose a reason for hiding this comment

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

We need to omit these props in the types because the pnpm proptypes started to fail after the change in the Select definition below. I believe this adjustment is now correct. Previously, it may not have been picking up the props correctly, possibly due to an incorrect intersection with muiName: string.

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.

@EyaOuenniche I made the expected changes. Thanks for the pull request.

@ZeeshanTamboli ZeeshanTamboli added the needs cherry-pick The PR should be cherry-picked to master after merge label Apr 6, 2024
@ZeeshanTamboli ZeeshanTamboli merged commit f3cb496 into mui:next Apr 6, 2024
20 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 6, 2024
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
bug 🐛 Something doesn't work component: select This is the name of the generic UI component, not the React module! needs cherry-pick The PR should be cherry-picked to master after merge package: material-ui Specific to @mui/material regression A bug, but worse typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[material-ui][Select] "Property 'muiName' does not exist" on Select
4 participants