Skip to content

Customize country codes of CountryPicker #46

@jhihruei

Description

@jhihruei

Sometimes we will not support all of the countries.
I would like to make options of country list could be customized,
I think we can do:

  1. Add property to enable/disable specify countries by isoCountryCode or CallingCode
  2. Add property to override default country codes

In my opinion, I prefer to override default country codes.
I think enable/disable specify countries will be a bit complex for the setting, override default country codes could be more flexible and easier to use.

So I would like to do:

  • Rename countryCodes to defaultCountryCodes (the country codes array)
  • Add a property countryCodes: Country[] to CountryPickerProps
  • Modify countryCode related function to use
    const countryCodes: Country[] = this.props.countryCodes || defaultCountryCodes

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions