xcarpentier / react-native-country-picker-modal

🇦🇶 Country picker provides a modal allowing a user to select a country from a list. It display a flag next to each country name.
https://reactnative.gallery/xcarpentier/country-picker
MIT License
1.07k stars 795 forks source link

Remove defaultProps - it is causing errors #526

Open KhrystynaPeryk opened 2 months ago

KhrystynaPeryk commented 2 months ago

Issue Description

When using CountryPicker, there are lots of errors in the console regarding defaultProps:

Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

Steps to Reproduce / Code Snippets

Install the package in bare expo project Import and use CountryPicker component

Expected Results

No errors in console

Additional Information

TarunBardawa commented 1 month ago

+1

mahdiguliyev commented 1 month ago

I am so facing with the same problem. Please resolve issue.

chico-oliveira commented 1 month ago

+1

Krcma commented 1 month ago

+1

novaakpatrik commented 1 month ago

+1

staniszewski commented 1 month ago

+1

S4mm4ael commented 4 weeks ago

+1

rxyces commented 4 weeks ago

+1

anhtuan219 commented 3 weeks ago

+1 Meanwhile, I'm using this to suppress that error

const error = console.error;
console.error = (...args: any) => {
  if (/defaultProps/.test(args[0])) return;
  error(...args);
};
betocolon23 commented 3 weeks ago

Same problem. Please help!

trongbinh15 commented 1 week ago

+1

iliassanati commented 1 week ago

+1