Open usajjad123 opened 1 year ago
The type of the geoIpLookup is incorrectly defined in IntTelInput.d.ts
It should be defined as a function taking callback as an argument: geoIpLookup?: (callback: (countryCode: string) => void) => void
This can be seen in the documentation and code too:
It is incorrectly defined as: geoIpLookup?: (countryCode: string) => void
This causes typescript error when providing geoIpLookup:
Only needed slight change in the type as suggested above
Code:
<IntlTelInput preferredCountries={['ae', 'pk']} geoIpLookup={async function (cb) { const info = await getIpInfo() // calling the ipinfo.io api const countryCode = info && info.country ? info.country : 'pk' cb(countryCode) }} formatOnInit={false} format={false} />
The type of the geoIpLookup is incorrectly defined in IntTelInput.d.ts
Expected Behavior
It should be defined as a function taking callback as an argument: geoIpLookup?: (callback: (countryCode: string) => void) => void
This can be seen in the documentation and code too:
Current Behavior
It is incorrectly defined as: geoIpLookup?: (countryCode: string) => void
This causes typescript error when providing geoIpLookup:
Possible Solution
Only needed slight change in the type as suggested above
Steps to Reproduce
Code:
Environment