A Country Picker Component for React Native
Xavier Carpentier is making sure that your App is going to be ready to hit all App/Play Store around the globe. Check his new Component that is letting your users pick their Country through a Modal.
Things are going to get even better when the Android support for Modal is coming in React Native v0.23!
react-native-country-picker-modal on GitHub
Country picker provides a modal allowing a user to select a country from a list. It display a flag next to each country name.
class Example extends Component {
constructor(props) {
StatusBarIOS.setHidden(true);
super(props);
this.state = {
cca2: "US",
};
}
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to Country Picker !</Text>
<CountryPicker
onChange={(value) => this.setState({ country: value })}
cca2={this.state.cca2}
translation="eng"
/>
<Text style={styles.instructions}>press on the flag</Text>
{this.state.country && (
<Text style={styles.data}>
{JSON.stringify(this.state.country, null, 2)}
</Text>
)}
</View>
);
}
}