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

[Autocomplete] Support readonly type for the options #25155

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

silver-snoopy
Copy link
Contributor

This PR is aiming to fix: #24639

Description

  • Enable Autocomplete component to use const types
  • Add test for typing

Additional information
There is two possible solution to address this:
ReadonlyArray<T> and T[] | Readonly<T[]>

I took the former, but happy to change it to to latter if it is more aligned with the the project directives.

@mui-pr-bot
Copy link

mui-pr-bot commented Mar 1, 2021

No bundle size changes

Generated by 🚫 dangerJS against d830a6f

@oliviertassinari oliviertassinari added component: autocomplete This is the name of the generic UI component, not the React module! typescript labels Mar 1, 2021
@oliviertassinari oliviertassinari changed the title [Autocomplete] Enable autocomplete to use const type [Autocomplete] Support const type for the options Mar 1, 2021
@oliviertassinari oliviertassinari changed the title [Autocomplete] Support const type for the options [Autocomplete] Support readonly type for the options Mar 1, 2021
@oliviertassinari oliviertassinari requested a review from eps1lon March 2, 2021 13:56
Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Thanks! Appreciate the added test 👍

@oliviertassinari oliviertassinari merged commit 3d0efb1 into mui:next Mar 2, 2021
@oliviertassinari
Copy link
Member

@silver-snoopy Thanks for taking the time to look into testing this. It's refreshing to see a contribution form the community that does it right, without needing a maintainer to guide them all the way :)

@silver-snoopy
Copy link
Contributor Author

Thanks @oliviertassinari @eps1lon !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Autocomplete] options does not accept const assertions array with TypeScript
4 participants