State Management
useSelect
About
Select values from a list easily. List selection hook for react.
Examples
Basic usage
Arguments
| Argument | Type | Description | Default value | 
|---|---|---|---|
| list | Array | List of items for which the selection is used | undefined | 
| initialIndex | number | Initially selected index | 0 | 
Returned Object
| Returned object attributes | Type | Description | 
|---|---|---|
| index | int | Index of currently selected index | 
| item | any | Currently selected item | 
| setIndex | function | Update selected index | 
| setItem | function | Update selected item |