react-select-country-list
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "react-select-country-list", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Maps ISO 3166-1-alpha-2 codes to English country names and match react-select options props", | ||
@@ -5,0 +5,0 @@ "main": "country-list.js", |
# country-list | ||
Maps ISO 3166-1-alpha-2 codes to English country names and vice versa. | ||
Maps ISO 3166-1-alpha-2 codes to English country names and match react-select options props. | ||
@@ -59,3 +59,34 @@ Uses data from http://data.okfn.org/data/country-list | ||
### react-select | ||
```js | ||
class CountrySelector extends Component { | ||
constructor(props) { | ||
super(props) | ||
this.options = countryList().getData() | ||
this.state = { | ||
options: this.options, | ||
value: null, | ||
} | ||
} | ||
changeHandler = value => { | ||
this.setState({ value }) | ||
} | ||
render() { | ||
return ( | ||
<Select | ||
options={this.state.options} | ||
value={this.state.value} | ||
onChange={this.changeHandler} | ||
/> | ||
) | ||
} | ||
} | ||
``` | ||
### Use with | ||
@@ -62,0 +93,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18608
102