Async options loading

Load options dynamically from an API as the user types:

typescript
1const [options, setOptions] = useState([])
2
3<Select
4 label="User"
5 searchable
6 onSearch={async (query) => {
7 const results = await api.searchUsers(query)
8 setOptions(results.map(u => ({
9 value: u.id,
10 label: u.name
11 })))
12 }}
13>
14 {options.map(opt => (
15 <Select.Option key={opt.value} value={opt.value}>
16 {opt.label}
17 </Select.Option>
18 ))}
19</Select>

Async loading with debounced search