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

Readonly select items prop #4977

Conversation

maclockard
Copy link
Contributor

Fixes #4976

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

Added readonly annotations to select props

Reviewers should focus on:

The types

Screenshot

@@ -18,7 +18,7 @@
* A custom predicate for returning an entirely new `items` array based on the provided query.
* See usage sites in `IListItemsProps`.
*/
export type ItemListPredicate<T> = (query: string, items: T[]) => T[];
export type ItemListPredicate<T> = (query: string, items: readonly T[]) => T[];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing the types of callback arguments may cause compile breaks for consumers, but should be easily fixed, since if they were mutating this argument here, it was probably causing problems

@adidahiya
Copy link
Contributor

closing because it's failing the build. lmk if you want to update & pursue this change again

@adidahiya adidahiya closed this Mar 16, 2022
@maclockard
Copy link
Contributor Author

@adidahiya fixed the build, but needed to open a new PR to get the changes: #5171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select's types don't accept readonly item arrays
2 participants