react-intl-tel-input icon indicating copy to clipboard operation
react-intl-tel-input copied to clipboard

Country options don't work if "countriesData" is passed

Open anetecima opened this issue 2 years ago • 1 comments

Country data is undefined if passed through countriesData prop

Expected Behavior

countries should be displayed the same as when the country data isn't passed.

Current Behavior

Screenshot (498) can be checked here - https://codesandbox.io/s/nervous-dust-nwh12t?file=/src/App.js

anetecima avatar Jul 07 '22 12:07 anetecima

the issue is the format that countriesData is expected in. in documentation it's countriesData?: CountryData[] | null where countryData is an object while in reality an array is expected for each country. the initialization should be removed if countriesData is passed or the format changed to this - ['Cambodia (កម្ពុជា)', 'kh', '855'] I'd be happy to fix this, but I need permission to push a new branch.

anetecima avatar Jul 08 '22 10:07 anetecima