Problem description:
According to the docs:
changes: These are the properties that actually have changed since the last state change. This also has a type property which you can learn more about in the stateChangeTypes section.
Yet in index.d.ts:
onStateChange?: (changes: Partial<UseComboboxState<Item>>) => void
export interface UseComboboxState<Item> {
highlightedIndex: number
selectedItem: Item
isOpen: boolean
inputValue: string
}
There's no type field
Suggested solution:
The field seems to be present for useMultipleSelection:
onStateChange?: (changes: UseMultipleSelectionStateChange<Item>) => void
export interface UseMultipleSelectionStateChange<Item>
extends Partial<UseMultipleSelectionState<Item>> {
type: UseMultipleSelectionStateChangeTypes
}
So I guess creating two new interfaces that are extending the Use.*State interfaces seems the most consistent option.
downshiftversion: 5.2.0Problem description:
According to the docs:
Yet in
index.d.ts:There's no
typefieldSuggested solution:
The field seems to be present for
useMultipleSelection:So I guess creating two new interfaces that are extending the
Use.*Stateinterfaces seems the most consistent option.