Can i change the flag to the country code?
adityanegara opened this issue · comments
Aditya Negara commented
For example if i pick 'Indonesia' can the selected options render '+62' not Indonesia Flag?
Nikolay commented
What?
Michael Schmidt commented
We do the same thing (because the flag icons are ugly):
We generate an object with all the country calling codes and pass it to the flags
attribute:
const flagOptions = useMemo(() => Object.fromEntries(getCountries().map((country: Country) => (
[country, () => <>+{getCountryCallingCode(country)}</>]
))), []);
flags={flagOptions}