Vehicle look up
npm link/install iros-vehicle-lookup
import VehicleLookup from 'iros-vehicle-lookup'
class Example extends Component {
handleOnDataUpdate = (data) =>{
console.log("data from Vehicle Lookup:", data);
//update you vehicle info
//data structure:
/*
let data= {
parmas: null || object,
model: '',
make: '',
year: '',
seats: '',
bodyType: '',
abi: '',
};
*/
}
render(){
return(
<VehicleLookup url='example.com' apiKey='key' params={params1: 'data'} onDataUpdate = {handleOnDataUpdate/>
)
}
};
Prop | Type | Required | Description |
---|---|---|---|
url | String | ✓ | url base to make the request |
apiKey | String | x-api-key | |
params | Object | useful to share info between components | |
onDataUpdate | Function | ✓ | return de vehicle data |
debug | Bool | show the formik state |