$ npm install -S react-thai-address-autocomplete
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>
);
}}
/>
- Address
{
'city': 'city', // string;
'province': 'province', // string;
'tumbon': 'tumbon', // string;
'zipcode': 10001, // string | number
}
type:
Address
type:
(address: Address) => void
type:
(item: Address, index: number) => JSX.Element