You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// For showing picker just put show state to show prop
116
+
<CountryPicker
117
+
show={show}
118
+
// when picker button press you will get the country object with dial code
119
+
pickerButtonOnPress={(item) => {
120
+
setCountryCode(item.dial_code);
121
+
setShow(false);
122
+
}}
123
+
ListHeaderComponent={ListHeaderComponent}
124
+
popularCountries={['en', 'ua', 'pl']}
125
+
/>
126
+
</View>
127
+
);
128
+
}
129
+
```
130
+
69
131
### List
70
132
71
133
```js
@@ -123,6 +185,9 @@ Below are the props you can pass to the React Component.
123
185
| onBackdropPress | function | null | onBackdropPress={() => setShow(false)} | If you want to close modal when user taps on the modal background. |
124
186
| initialState | string | | initialState={'+380'} | Sometimes you need to pre-select country for example by user current location so you may use this prop. |
125
187
| excludedCountries | array | | excludedCountries={['RU', 'BY']} | In this prop you can define list of countries which you want to remove by adding their codes. |
188
+
| showOnly | array | | showOnly={['UA', 'EN']} | This prop allow you to configure which countries you want to show. |
189
+
| popularCountries | array | | popularCountries={['UA', 'EN']} | This prop allow you to send popular countries array to yout ListHeaderComponent. |
190
+
| ListHeaderComponent | JSX.Element | | ListHeaderComponent={ListHeaderComponent} | This prop allow you to create header component to show popular countries on top of list! Check example section with ListHeaderComponent |
126
191
127
192
:grey_exclamation: Also you can use all other FlatList and TextInput props if you need. :grey_exclamation:
0 commit comments