1// npm install react-geocode
2// Don't forget to enter your Google API key in line 9 or this will not work
3
4import Geocode from "react-geocode";
5
6Geocode.setApiKey("<INSERT YOUR API KEY HERE>"); // Enter Google Maps API here
7Geocode.enableDebug();
8
9Geocode.fromLatLng("44.5", "-89.5").then(
10 response => {
11 const address = response.results[0].formatted_address;
12 console.log(address);
13 },
14 error => {
15 console.error(error);
16 }
17);