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 getAllCountrieshere.
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 exportsgetAllCountries
here.