select-autocomplete-api
v0.1.1
Published
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
Downloads
2
Maintainers
Readme
Installation
Install this package with npm:
$ npm install --save select-autocomplete-api
or using yarn:
$ yarn add select-autocomplete-api
Usage
import { SelectAutoComplete } from select-autocomplete-api;
<SelectAutoComplete
label={"labelName"}
data={array.map(val => {
return {
id: val.id,
label: val.name,
}
})}
onSearch={debounce(handleSearchFromAPI, 300)}
onChange={(item) => {
if (item) {
setState(item.id)
}
}}
loading={isLoading}
onClear={true}
/>