shukerullah / react-geocode

A React module to transform a description of a location (i.e. street address, town name, etc.) into geographic coordinates (i.e. latitude and longitude) and vice versa.
MIT License
207 stars 35 forks source link

outputFormat required in setDefaults #50

Closed jonathan-chin closed 1 month ago

jonathan-chin commented 7 months ago

I tried to use setDefaults as it is shown in the README by specifying only key, language, and region.

however, my typescript compiler complained that outputFormat was required. not a big deal but might be confusing for anyone who wants to quickly try the package and is just following the README.

Devdannnny commented 3 months ago

You can use this:

import { OutputFormat } from "react-geocode";

setDefaults({ key: "", // Your API key here. language: "en", // Default language for responses. region: "gh", // Default region for responses. outputFormat:OutputFormat.JSON });

jonathan-chin commented 1 month ago

I guess my issue was that the sample code in the README would not compile. I'd suggest updating it to include the required parameters.