/google-autocomplete-api-react-demo

Demo project showing how to set up a React input component with autocomplete functionality using Google APIs

Primary LanguageTypeScript

Google Autocomplete API + React demo

Netlify Status

https://google-autocomplete-api-react-demo.netlify.app

Demo project showing how to set up a React input component with autocomplete functionality using Google APIs.

Screenshot of live demo

Suggestions are shown as a plain list in this demo. Normally, you'll want to render them in a suggestions popover below the input.

➡️ For more info, out this step-by-step tutorial: Simple guide to implementing a place/address autocomplete input with Google APIs and React

Instructions

  • Set up a Google Cloud project
  • Enable the Maps JavaScript API and the Places API.
  • Create an access token to use those APIs, and set it in .env.local with name REACT_APP_GOOGLE_MAPS_API_API_TOKEN

Run npm install and npm run start to kick it off locally.

Attributions

It was made with care starting from Create React App. Create React App is not dead!