// the find
wellyshen/use-places-autocomplete
😎 📍 React hook for Google Maps Places Autocomplete.
A React hook that wraps the Google Maps Places Autocomplete API, handling debounce, sessionStorage caching, and lazy initialization in ~1.7KB. Aimed at developers who need a place search input without writing the Google Maps boilerplate themselves. It's headless — you bring your own UI.
Built-in sessionStorage caching per query key is a genuinely useful cost-saving feature that most hand-rolled implementations skip. The `initOnMount: false` + manual `init()` pattern handles the async script loading problem cleanly instead of punting it to the user. Utility functions (`getGeocode`, `getLatLng`, `getZipCode`, `getDetails`) cover 90% of what you'd do after selecting a suggestion, so the hook is actually useful end-to-end. TypeScript types are first-class with `@types/google.maps` integration rather than bolted on.
The maintainer is actively looking for someone to take over — 'seeking dedicated maintainers' in the README is a yellow flag for a dependency. The new Places API (released 2023) is not mentioned anywhere; the hook is built against the legacy `AutocompleteService`, and Google has deprecated the old API with a sunset deadline, so adopters will eventually hit a forced migration. Caching via sessionStorage is scoped per tab and cleared on session end, which is fine for most use cases but will surprise anyone expecting cross-tab or persistent behavior. No SSR story — `window.google.maps` references mean Next.js or Remix users need to handle the server-side case themselves.