Skip to content

Conversation

elliottkember
Copy link

@elliottkember elliottkember commented Mar 7, 2025

Fixes issues with defaultProps, which is incompatible with 0.78 / React 19 and throws an error.

Fixes #536
Fixes #526
Fixes #535

Duplicates (sorry, I didn't see them)
Duplicate of #531
Duplicate of #529

@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

Copy link

@JamieColclough JamieColclough left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xcarpentier This is a really simple change that will help a lot of people who are using libraries that depend on this. Please can you merge, it's only a few lines of changes?

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