react-native-country-selector

1.0.7 • Public • Published

This is a new React Native project, bootstrapped using @react-native-community/cli.

Installation

yarn add react-native-country-selector

or

npm install react-native-country-selector

Usage

import CountryPicker from 'react-native-country-selector'

 <CountryPicker
   visible={showPicker}
   onClose={() => setShowPicker(false)}
   onCountrySelected={(data) => {
      console.log(JSON.stringify(data))

    }}
/>

/*
OUTPUT
{"name":"Australia","phone_code":"+61","code":"AU","currency":{"code":"AUD","name":"Dollar","symbol":"$"},
"id":14,"flag":13}
*/

Props

visible : true or false values Show or hide picker.
onClose : function to perform hiding/closing the country selector.
onCountrySelected: function . Perform an operation after selecting the country of your choice. Get the data and manipulate it :)

Package Sidebar

Install

npm i react-native-country-selector

Weekly Downloads

27

Version

1.0.7

License

ISC

Unpacked Size

883 kB

Total Files

330

Last publish

Collaborators

  • cenim