useAutocomplete
useAutocomplete
provides result and method for the autocomplete pipeline.
Usage
Editable Example
​
Suggestions
Autocomplete
Editable Example
​
Suggestions
Anatomy
useAutocomplete
returns an object containing the following properties:
Name | Type | Default | Description |
---|---|---|---|
suggestions | string[] | [] | An array of suggestions for the query. |
completion | string | A string that is predicted by the pipeline base on the current query. | |
search | (q?: string) => void | Function used to search for suggestions. | |
searching | boolean | false | A boolean that is true when the autocomplete is currently searching for the latest result. |
redirects | { [redirectQuery: string]: RedirectTarget } | {} | An object which maps a search string, redirectQuery , to possible redirect completions for that string. See the JS SDK for detailed object shape. |
Parameters
Name | Type | Default | Description |
---|