First of all, thanks for all your hard work trying to keep this component bug-free. In my project, the requirement is to extract the country calling code when the country dropdown changes. For that I'm relying upon the "onCountryChange” handler which returns the ISO country code. However, I need to extract the calling code instead. For instance, for GB it should return 44 or +44.
I have ended up using the getCountryCallingCode() to get the corresponding calling code of the country. For example,
getCountryCallingCode(‘GB') // returns 44.
Although I have achieved what I wanted, I’m just wondering, Is it possible to return an object with the country and calling code onCountryChange. Something like,
{ country: 'GB', callingCode: '44' }
First of all, thanks for all your hard work trying to keep this component bug-free. In my project, the requirement is to extract the country calling code when the country dropdown changes. For that I'm relying upon the "onCountryChange” handler which returns the ISO country code. However, I need to extract the calling code instead. For instance, for GB it should return 44 or +44.
I have ended up using the getCountryCallingCode() to get the corresponding calling code of the country. For example,
getCountryCallingCode(‘GB') // returns 44.
Although I have achieved what I wanted, I’m just wondering, Is it possible to return an object with the country and calling code onCountryChange. Something like,
{ country: 'GB', callingCode: '44' }
The ask is similar to this - #294