thegamenicorus / react-native-phone-input

Phone input box for React Native
https://www.npmjs.com/package/react-native-phone-input
MIT License
394 stars 447 forks source link

export getAllCountries separately #41

Open stevula opened 6 years ago

stevula commented 6 years ago

I am passing a custom country list to the component that is based off of the full country list. Basically, I am filtering it down to the countries I want to support and mapping the country name to ${country.name} (+${country.dialCode}).

Currently, if you have a ref to the component you can call instance.getAllCountries(). This doesn't work in the case described though, because the function needs to be passed to <PhoneInput> as a prop prior to instantiation.

react-native-country-picker-modal has a similar country list API and exports getAllCountries here.