Closed 15110011 closed 4 years ago
Getting the same issue
Found a hacky workaround until this gets solved. Use the useState
hook in your component to store the countryCode. Show the flag additionally using:
import CountryPicker, {FlagButton} from 'react-native-country-picker-modal';
<FlagButton withEmoji={true} countryCode="US" />
<CountryPicker
onSelect={onCountrySelect}
withEmoji={true}
withFlag={true}
withFlagButton={true}
/>
Tweak the flagButton onPress for your desired behaviour (open/close modal).
@ispulkit Its a component instead of props? its different from the docs and examples. btw, thank you @ispulkit
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi,
Just pass in countryCode as a prop and it should work just fine.
<CountryPicker countryCode={'FR'} withFlag withCountryNameButton withAlphaFilter withCallingCode onSelect={() => { // do something }} />
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Issue Description
I tried to use withFlagButton but It still don't show any flag icon or image
Steps to Reproduce / Code Snippets
<CountryPicker onSelect={value => { onSelect(value); }} cca2={cca2} translation="eng" withFlag withCallingCode visible withFlagButton={withFlagButton} withFilter placeholder="" withEmoji />