-
Notifications
You must be signed in to change notification settings - Fork 941
fix type for itemToString #505
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
itemToString can be called with a null item
kentcdodds
approved these changes
Jul 13, 2018
Contributor
Author
|
Thanks for merging this so quickly! Do you have an idea of when the next release will be? |
kentcdodds
pushed a commit
that referenced
this pull request
Jul 13, 2018
There was an issue with a patch release, so this manual-releases.md change is to release a new patch version. I think the issue is related to my tokens all being deleted. I've updated the token so it should work this time. Reference: #505
Member
|
It's been published just now! :) |
Contributor
Author
|
👍 Thanks! |
Rendez
pushed a commit
to Rendez/downshift
that referenced
this pull request
Sep 30, 2018
itemToString can be called with a null item
Rendez
pushed a commit
to Rendez/downshift
that referenced
this pull request
Sep 30, 2018
There was an issue with a patch release, so this manual-releases.md change is to release a new patch version. I think the issue is related to my tokens all being deleted. I've updated the token so it should work this time. Reference: downshift-js#505
kimroen
added a commit
to kimroen/downshift
that referenced
this pull request
Jun 8, 2020
This makes it so the argument passed to `itemToString` can be `null` for the following interfaces: - `UseSelectProps` - `UseComboboxProps` - `Actions` This makes them behave in line with various documentation, which states that they can receive null: - [`useCombobox#itemToString`](https://github.com/downshift-js/downshift/tree/master/src/hooks/useCombobox#itemtostring) - [`useSelect#itemToString`](https://github.com/downshift-js/downshift/tree/master/src/hooks/useSelect#itemtostring) - [Downshift component](https://github.com/downshift-js/downshift#itemtostring) I didn’t touch `useMultipleSelection`, because its documentation didn’t have this line: [`useMultipleSelection#itemToString`](https://github.com/downshift-js/downshift/tree/master/src/hooks/useMultipleSelection#itemtostring) I was also not sure about `itemToString` passed to the various `A11y`-functions, so I didn’t touch these either. This fix has previously been applied to the main Downshift component: downshift-js#505 This will be a breaking change for people using typescript with `strictNullChecks` turned on if they don’t already check for null. I will leave that decision with you, though.
5 tasks
silviuaavram
pushed a commit
that referenced
this pull request
Jun 27, 2020
This makes it so the argument passed to `itemToString` can be `null` for the following interfaces: - `UseSelectProps` - `UseComboboxProps` - `Actions` This makes them behave in line with various documentation, which states that they can receive null: - [`useCombobox#itemToString`](https://github.com/downshift-js/downshift/tree/master/src/hooks/useCombobox#itemtostring) - [`useSelect#itemToString`](https://github.com/downshift-js/downshift/tree/master/src/hooks/useSelect#itemtostring) - [Downshift component](https://github.com/downshift-js/downshift#itemtostring) I didn’t touch `useMultipleSelection`, because its documentation didn’t have this line: [`useMultipleSelection#itemToString`](https://github.com/downshift-js/downshift/tree/master/src/hooks/useMultipleSelection#itemtostring) I was also not sure about `itemToString` passed to the various `A11y`-functions, so I didn’t touch these either. This fix has previously been applied to the main Downshift component: #505 This will be a breaking change for people using typescript with `strictNullChecks` turned on if they don’t already check for null. I will leave that decision with you, though.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per your
README.md,itemToStringcan be called with a nullItem.This PR fixes your typings to reflect that.