downshift
Version:
🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.
17 lines (16 loc) • 576 B
TypeScript
type DropdownState<Item> = {
isOpen: boolean;
inputValue: string;
highlightedIndex: number;
selectedItem: Item | null;
};
/**
* Check if a state is equal for dropdowns, by comparing isOpen, inputValue, highlightedIndex and selected item.
* Used by useSelect and useCombobox.
*
* @param prevState The previous dropdown state.
* @param newState The new dropdown state.
* @returns Whether the states are deeply equal.
*/
export declare function isDropdownStateEqual<Item>(prevState: DropdownState<Item>, newState: DropdownState<Item>): boolean;
export {};