1.0.8 • Published 6 years ago
react-thai-address-autocomplete v1.0.8
react-thai-address-autocomplete
install
$ npm install -S react-thai-address-autocomplete
usage
import ThaiAddressAutoComplete, {
Address,
} from './ThaiAddressAutoComplete';
const address: Address = {
'city': '',
'province': '',
'tumbon': '',
'zipcode': '',
};
<ThaiAddressAutoComplete
address={address}
handleSelect={(address: Address) => {
console.log(address);
}}
renderItems={(item: Address, index: number) => {
return (
<p>
{JSON.stringify(item)}
</p>
);
}}
/>
types
- Address
{
'city': 'city', // string;
'province': 'province', // string;
'tumbon': 'tumbon', // string;
'zipcode': 10001, // string | number
}
props
address
type:
Address
handleSelect
type:
(address: Address) => void
renderItems
type:
(item: Address, index: number) => JSX.Element