GeorgeHop / react-native-country-codes-picker

⚡ ⚡ ⚡This lib. provide multi lang. country picker with search functionality. Fully crossplatform and supported on React-native and expo. Didn't find your country ? Just add the required countries or locales and make a PR.⚡ ⚡ ⚡
https://github.com/GeorgeHop/react-native-country-codes-picker
MIT License
143 stars 78 forks source link

Ts error in CountryPicker #63

Open amitrajora14 opened 1 year ago

amitrajora14 commented 1 year ago

the given type for the CountyPicker is a following,

interface Props { excludedCountries?: string[], showOnly?: string[], popularCountries?: string[],

style?: Style,

show: boolean,
enableModalAvoiding?: boolean,
disableBackdrop?: boolean,

onBackdropPress?: (...args: any) => any,
pickerButtonOnPress: (item: CountryItem) => any,
itemTemplate?: (props: ItemTemplateProps) => JSX.Element,
ListHeaderComponent?: (props: ListHeaderComponentProps) => JSX.Element,
onRequestClose?: (...args: any) => any,

lang: string,
inputPlaceholder?: string,
inputPlaceholderTextColor?: TextStyle['color'],
searchMessage?: string,
androidWindowSoftInputMode?: string,
initialState?: string,

}

Now, As I my writing test in my application where I have used this CounteryPicker component, so, I have to test this CountryPicker for that I have find the element of the text input from where I can search the country and then select that country, so for that I have to pass testId to the textInput, the type of CountryPicker does not have the testID props but If I am passing it forcefully than I works.

GeorgeHop commented 1 year ago

Hi, I will look into it.

gbyesiltas commented 1 year ago

Hey guys, we had the same issue so I created a PR in this repo that just adds some default testIDs so people can target the existing ones :)