react-autofill-address

v1.0.13
React component for google address autofill, this component will try to find an address on any input change
google places react autocomplete autofill

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>
  }
}

Metadata

  • ISC
  • Whatever
  • Unknown
  • released 2/27/2018

Downloads

Maintainers