iros-address-lookup
v0.0.3
Published
Address look up
Readme
Project Title
Address look up
Installattion
npm install iros-address-lookup
Usage
import AddressLookup from 'iros-address-lookup'
class Example extends Component {
handleOnDataUpdate = (data) =>{
console.log("data from Address Lookup:", data);
//update you address info
//data structure:
/*
let data= {
addressLine1: ''
addressLine2: ''
addressLine3: ''
addressLine4: ''
addressLine5: ''
city: ''
county: ''
post_code: ''
};
*/
}
render(){
let addressData = {
post_code: 'M1 3HY',
addressLine1: 'Chorlton Street',
city: 'Manchester',
county: 'Greater Manchester'
}
return(
<AddressLookup url='example.com' apiKey='key'
addressData={null}
onDataUpdate = {handleOnDataUpdate debug={false}/>
)
}
};Props
| Prop | Type | Required | Description | | :--- | :--- | :---: | :--- | | url| String | ✓ | url base to make the request| | apiKey| String | ✓| key| | onDataUpdate | Function | ✓ | return de address data| | addressData | Object | |fill in the fields of the form | | debug | Bool | | show the formik state|
