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 Flatlist ListHeaderComponent #53

Open srikargunnam opened 1 year ago

srikargunnam commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-country-codes-picker@2.3.1 for the project I'm working on.

I couldn't spent much time on fixing this ts error, hence i just ignored the line which is causing the ts error.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-country-codes-picker/index.tsx b/node_modules/react-native-country-codes-picker/index.tsx
index 1d2131f..fc7e6e2 100644
--- a/node_modules/react-native-country-codes-picker/index.tsx
+++ b/node_modules/react-native-country-codes-picker/index.tsx
@@ -394,6 +394,7 @@ export const CountryList = ({
             style={[style?.itemsList]}
             keyboardShouldPersistTaps={'handled'}
             renderItem={renderItem}
+            // @ts-ignore
             ListHeaderComponent={(popularCountries && ListHeaderComponent && !searchValue ) &&
                 <ListHeaderComponent countries={preparedPopularCountries} lang={lang}/>}
             {...rest}

This issue body was partially generated by patch-package.

mawais2001 commented 3 months ago

this method is difficult bro