react-native-gp-autocomplete
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

react-native-places-autocomplete

Google Places Autocomplete for React Native

This library is a work in progress and currently very much written to suit my needs. I will improve it and make it more useful over time.

Installation

npm install react-native-gp-autocomplete

Usage

import { GooglePlacesAutocomplete } from 'react-native-gp-autocomplete';

// ...

const onSearchError = React.useCallback((error: PlacesError) => {
  console.log(error);
}, []);

const onPlaceSelected = React.useCallback((place: PlaceDetails) => {
  console.log(place);
}, []);

// ...

<GooglePlacesAutocomplete
  apiKey={API_KEY}
  requestConfig={{ countries: ['US'] }}
  onPlaceSelected={onPlaceSelected}
  onSearchError={onSearchError}
/>;

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Package Sidebar

Install

npm i react-native-gp-autocomplete

Weekly Downloads

2

Version

1.0.6

License

MIT

Unpacked Size

137 kB

Total Files

124

Last publish

Collaborators

  • alanhughes