-
-
Notifications
You must be signed in to change notification settings - Fork 836
Open
Description
Hello Xavier,
I’ve been using your package and noticed a warning that could be addressed to ensure future compatibility. The warning is:
Warning: CountryList: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
This warning occurs because some components in the package use the defaultProps pattern, like this:
Component.defaultProps = {
prop1: 'defaultValue1',
prop2: 'defaultValue2'
}
To resolve this, the components could be updated to use JavaScript default parameters, like so:
function Component({ prop1 = 'defaultValue1', prop2 = 'defaultValue2' }) {
// Component logic here
}
As React is deprecating defaultProps for function components in future releases, I suggest updating the components to use JavaScript default parameters instead.
I’d be happy to contribute to this update if you’re open to it. Please let me know if this is something you’d like to pursue, and I can submit a pull request with the necessary changes.
Thank you for your time and for creating this package!
Tiagochicoo, bensaadi and Juancml1913
Metadata
Metadata
Assignees
Labels
No labels