react-geocode icon indicating copy to clipboard operation
react-geocode copied to clipboard

outputFormat required in setDefaults

Open jonathan-chin opened this issue 1 year ago • 1 comments

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.

jonathan-chin avatar Mar 13 '24 05:03 jonathan-chin

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 });

Devdannnny avatar Jul 14 '24 10:07 Devdannnny

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.

jonathan-chin avatar Sep 24 '24 20:09 jonathan-chin