react-autofill-address
v1.0.15
Published
React component for google address autofill, this component will try to find an address on any input change
Downloads
36
Maintainers
Readme
React Autofill Address
React component for google address autofill, this component will try to find an address on any input change
npm install react-autofill-address --save
import React, { Component } from 'react'
import Address from 'react-autofill-address'
export default class extends Component {
constructor (props) {
super(props)
this.state = {}
}
setPlace (place) {
this.setState({ place })
}
render () {
const { place } = this.state
return <div>
<Address
apikey={process.env.GOOGLE_API_KEY}
onChange={place => this.setPlace(place)}
timer={300} // Throttle the onChange event
/>
<pre>{JSON.stringify(place, null, 2)}</pre>
</div>
}
}