GitHunt
EV

evanrs/use-google-maps-sdk

use-google-maps-sdk

A react hook that wraps the Google Maps SDK.

npm install use-google-maps-sdk

Supported Methods

Currently limited to the JS SDK and a handful of methods.

import {
  useGoogleMapsSDK,
  usePlacesAutocompleteService,
  usePlacesAutocompleteSessionToken,
  usePlacePredictions
} from 'use-google-maps-sdk

Support will expand to include all methods that can be represented as a hook.

usePlacePredictions

usePlacePredictions improves on the SDK by ignoring out of order updates. The native SDK offers no resolution guarantees — when using the hook prediction results will always represent the most recent input for which we've resolved a response.

License

MIT Licensed

Languages

TypeScript100.0%

Contributors

Created February 9, 2020
Updated March 17, 2023
evanrs/use-google-maps-sdk | GitHunt