2 years ago

#70829

test-img

KOTISWAR

TypeError: Cannot read properties of undefined Google maps API

can anyone please tell me why this error is coming in google places API code

TypeError: Cannot read properties of undefined (reading 'location') ur.onPlaceChanged http://localhost:3000/static/js/main.chunk.js:82:49

 79 | const onLoad = autoC => setAutocomplete(autoC);
  80 | 
  81 | const onPlaceChanged = () => {
> 82 |   const lat = autocomplete.getPlace().geometry.location.lat();
     |                                               ^  83 |   const lng = autocomplete.getPlace().geometry.location.lng();
  84 |   setCoords({
  85 |     lat,[enter image description here][1]

reactjs

google-maps

google-places-api

0 Answers

Your Answer

Accepted video resources