xcarpentier / react-native-country-picker-modal

🇦🇶 Country picker provides a modal allowing a user to select a country from a list. It display a flag next to each country name.
https://reactnative.gallery/xcarpentier/country-picker
MIT License
1.07k stars 796 forks source link

Prefill with country code #456

Closed JoymenOpoyi closed 2 years ago

JoymenOpoyi commented 2 years ago

Issue Description

If the value for default code is dynamic it doesn't accept it

Steps to Reproduce / Code Snippets

Used this function for conversion = https://github.com/xcarpentier/react-native-country-picker-modal/issues/392

I tried this function, it returns the country code properly but that object is not accepted by defaultCode prop, pls help @RamijM [FILL THIS OUT]

Expected Results

Should change default country code automatically(prefill)

[FILL THIS OUT]

Additional Information

JoymenOpoyi commented 2 years ago

I also tried coveting that object using countrycode as CountryCode(type from library) import { CountryCode } from "react-native-country-picker-modal";