react-phone-input-2
react-phone-input-2 copied to clipboard
Some of islands having own iso2 and dial code are missing.
Some of islands having own iso2 code and dialing code but belonging to bigger country, are not existing in the list of rawCountries. Therefore when you try to set it as a defaultCountry the ReactPhoneInput falls with "unable to get value of
Problematic countries(or islands) list is below 'Aland Islands', 'ax' belongs to 'Finland', 'fi' dial code is similar: 358 'Christmas Island', 'cx' belongs to 'Australia', 'au' dial code is similar: 61 'Cocos (Keeling) Islands', 'cc' belongs to 'Australia', 'au' dial code is similar: 61 'Guernsey', 'gg' belongs to 'United Kingdom', 'gb' dial code is similar: 44 'Isle of Man', 'im' belongs to 'United Kingdom', 'gb' dial code is similar: 44 'Jersey', 'je' belongs to 'United Kingdom', 'gb' dial code is similar: 44 'Pitcairn Islands', 'pn' belongs to 'New Zealand', 'nz' dial code is similar: 64 'Svalbard and Jan Mayen', 'sj' belongs to, 'Norway', 'no' dial code is similar: 47 'United States Minor Outlying Islands', 'um' belongs to 'United States', 'us' dial code is similar: 1 'Mayotte', 'yt' belongs to 'Reunion', 're', dial code is similar: 262
I overcame this problem with doing a substitutes(ax->fi, cx->au...) in the code that uses the control, so that I never put the iso2 codes that aren't existing in ReactPhoneInput, but this is terrible solution and will stay there only as a temporary solution.
With best regards, Valeri