-
Notifications
You must be signed in to change notification settings - Fork 933
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
types(hooks): improve Typescript for onChange funtions (#1580)
* types(hooks): improve for onChange funtions * migration guide * fix doctoc
- Loading branch information
1 parent
7997f76
commit d2b42e8
Showing
3 changed files
with
98 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Migration from v8 to v9 | ||
|
||
Downshift v8 receives a list of breaking changes, which are necessary to improve | ||
both the user and the developer experience. The changes are only affecting the | ||
hooks and are detailed below. | ||
|
||
## Table of Contents | ||
|
||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
- [onChange Typescript Improvements](#onchange-typescript-improvements) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
## onChange Typescript Improvements | ||
|
||
The handlers below have their types improved to reflect that they will always | ||
get called with their corresponding state prop: | ||
|
||
- useCombobox | ||
- onSelectedItemChange: selectedItem is non optional | ||
- onIsOpenChange: isOpen is non optional | ||
- onHighlightedIndexChange: highlightedIndex is non optional | ||
|
||
- useSelect | ||
- onSelectedItemChange: selectedItem is non optional | ||
- onIsOpenChange: isOpen is non optional | ||
- onHighlightedIndexChange: highlightedIndex is non optional | ||
- onInputValueChange: inputValue is non optional | ||
|
||
- useMultipleSelection | ||
- onActiveIndexChange: activeIndex is non optional | ||
- onSelectedItemsChange: selectedItems is non optional |
This file contains 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
This file contains 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