Skip to content

Replace defaultProps #538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

elliottkember
Copy link

Fixes #39

@hjjayakrishnan
Copy link

@xcarpentier Could you help merge these changes or assign someone to do so? Seems all checks have passed. Thx

@Tiagochicoo
Copy link

Please merge, thank you!

@vricosti
Copy link

vricosti commented Mar 17, 2025

If it's not merged soon I will create a @vricosti/react-native-country-picker-modal package as I already did for some unmaintained package (@vricosti/react-native-asset).
https://github.com/vricosti/react-native-country-picker-modal

@vricosti
Copy link

vricosti commented Mar 18, 2025

I tried to generate on my fork and I have ts errors:

vricosti@bifrost-Z490-VISION-D:~/Dev/react-native-country-picker-modal-vricosti$ yarn verify
src/CountryFilter.tsx:48:7 - error TS2783: 'placeholder' is specified more than once, so this usage will be overwritten.

48       placeholder={placeholder}
         ~~~~~~~~~~~~~~~~~~~~~~~~~

  src/CountryFilter.tsx:50:7
    50       {...props}
             ~~~~~~~~~~
    This spread always overwrites this property.

src/CountryFilter.tsx:49:7 - error TS2783: 'autoFocus' is specified more than once, so this usage will be overwritten.

49       autoFocus={autoFocus}
         ~~~~~~~~~~~~~~~~~~~~~

  src/CountryFilter.tsx:50:7
    50       {...props}
             ~~~~~~~~~~
    This spread always overwrites this property.


Found 2 errors in the same file, starting at: src/CountryFilter.tsx:48

so what about:

<TextInput
  testID="text-input-country-filter"
  autoCorrect={false}
  placeholderTextColor={filterPlaceholderTextColor}
  style={[
    styles.input,
    { fontFamily, fontSize, color: onBackgroundTextColor },
  ]}
  {...props} // Spread first to ensure other props are passed correctly
/>

{...props} already includes placeholder and autoFocus because it's built from CountryFilterProps.
If {...props} is spread before specific props, those props would overwrite it, but in your case, the reverse happens.

@KnotScientific
Copy link

KnotScientific commented Mar 20, 2025

Hi Can this get merged please? @xcarpentier

@vricosti
Copy link

Hi Can this get merged please? @xcarpentier

Merged here: https://github.com/vricosti/react-native-country-picker-modal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: filter coutnries
6 participants