How to use react-country-region-selector - 2 common examples

To help you get started, we’ve selected a few react-country-region-selector examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lianetoolkit / liane-toolkit / imports / ui2 / components / RegionSelect.jsx View on Github external
_getOptions = () => {
    const { country } = this.props;
    const countryIdx = CountryRegionData.findIndex(
      c => c[0] == country || c[1] == country
    );
    let options = [];
    if (countryIdx) {
      const regions = CountryRegionData[countryIdx][2].split("|");
      options = regions.map(region => {
        const splitted = region.split("~");
        return {
          value: splitted[1],
          label: splitted[0]
        };
      });
    }
    return options;
  };
  _getValue = () => {
github lianetoolkit / liane-toolkit / imports / ui2 / components / CountrySelect.jsx View on Github external
_getOptions = () => {
    return CountryRegionData.map(c => {
      return {
        value: c[1],
        label: c[0]
      };
    });
  };
  _getValue = () => {

react-country-region-selector

CountryDropdown and RegionDropdown React components for your forms.

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis

Similar packages