Skip to content

React depreciation warning of defaultProps occurring on TextInput.Icon (Suggested solution) #4402

Closed
@sethimcclaine

Description

@sethimcclaine

Current behaviour

Updating to "react-native": "0.74.1 / "react": "18.2.0" results in depreciation warning of defaultProps

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

This is noticed in TextInput.Icon, but grepping code base for defaultProps will likely reveal other instances

Expected behaviour

No deprication warnings

How to reproduce?

Preview

Screenshot 2024-05-09 at 10 50 26 AM

What have you tried so far?

updating src/components/TextInput/Adornment/TextInputIcon.tsx

ln 132
+ forceTextInputFocus = true,
- forceTextInputFocus,
ln 179-180
- TextInputIcon.defaultProps = {
-   forceTextInputFocus: true,
- };

Your Environment

software version
ios x
android x
react-native x.x.x
react-native-paper x.x.x
node x.x.x
npm or yarn x.x.x
expo sdk x.x.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions