React-Native Country Selector
npm install react-native-country
import { CountrySelector } from 'react-native-country';
// ...
const [selectedCountry, setSelectedCountry] = React.useState(null);
const handleSelectCountry = (country) => {
setSelectedCountry(country);
};
return (
<View style={styles.container}>
<Text style={{ fontSize: 20, marginBottom: 20 }}>
Selected Country: {selectedCountry?.name?.common || 'None'}
</Text>
<CountrySelector onSelect={handleSelectCountry} />
</View>
);
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library