Chun-Lin / react-select-country-list

This is the country list data format for react-select
MIT License
52 stars 35 forks source link

Added functionality to return { label: <country.label>, value: <country.value> } and tests with native support #12

Open Gorsargs opened 1 year ago

Gorsargs commented 1 year ago

getCountryByLabel() getCountryByValue() One may want to get a country object of a specific country, these are the methods

Usage countries.getCountryByLabel('Taiwan, Province of China') // { label: 'Taiwan, Province of China', value: 'TW' } countries.getCountryByValue('TW') // { label: 'Taiwan, Province of China', value: 'TW' }

Native Usage countries.native().getCountryByLabel('Taiwan, Province of China') // { label: '臺灣', value: 'TW' } countries.native().getCountryByValue('TW') // { label: '臺灣', value: 'TW' }