Skip to content
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

Migration to 'deprecated-react-native-prop-types' #94

Open
Dmitrycmc opened this issue Nov 10, 2022 · 0 comments
Open

Migration to 'deprecated-react-native-prop-types' #94

Dmitrycmc opened this issue Nov 10, 2022 · 0 comments

Comments

@Dmitrycmc
Copy link

Dmitrycmc commented Nov 10, 2022

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch reinput@3.7.2 for the project I'm working on.

The problem is that React Native since 0.69.0 moved
TextInput.propTypes
to
require('deprecated-react-native-prop-types').TextInputPropTypes

Here is the diff that solved my problem:

diff --git a/node_modules/reinput/src/Input/Input.js b/node_modules/reinput/src/Input/Input.js
index e362f59..44ba1dd 100644
--- a/node_modules/reinput/src/Input/Input.js
+++ b/node_modules/reinput/src/Input/Input.js
@@ -10,13 +10,15 @@ import Underline, { pickUnderlineProps } from '../Underline'
 import { defaultProps, propTypes, pickTextInputProps } from './props'
 import * as styles from './styles'
 
+const textInputPropTypes = require('deprecated-react-native-prop-types').TextInputPropTypes
+
 /**
  * @typedef {typeof defaultProps} ReinputProps
  * @augments {React.Component<ReinputProps, {}>}
  */
 export default class ReinputInput extends React.Component {
   /** @type {ReinputProps} */
-  static propTypes = { ...propTypes, ...TextInput.propTypes }
+  static propTypes = { ...propTypes, ...textInputPropTypes }
   static defaultProps = defaultProps
 
   constructor (props) {
diff --git a/node_modules/reinput/src/Input/props.js b/node_modules/reinput/src/Input/props.js
index e77152e..b2f97bc 100644
--- a/node_modules/reinput/src/Input/props.js
+++ b/node_modules/reinput/src/Input/props.js
@@ -9,8 +9,10 @@ import * as LabelProps from '../Label/props'
 import * as PlaceholderProps from '../Placeholder/props'
 import * as UnderlineProps from '../Underline/props'
 
+const textInputPropTypes = require('deprecated-react-native-prop-types').TextInputPropTypes
+
 export const propTypes = {
-  // ...TextInput.propTypes, // Breaks IDE auto-completion
+  // ...textInputPropTypes, // Breaks IDE auto-completion
   ...ErrorProps.propTypes,
   ...IconProps.internalPropTypes,
   ...LabelProps.internalPropTypes,
@@ -72,5 +74,5 @@ export const defaultProps = {
 }
 
 export const pickTextInputProps = (props) => {
-  return pick(props, Object.keys(TextInput.propTypes))
+  return pick(props, Object.keys(textInputPropTypes))
 }

This issue body was partially generated by patch-package.

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

No branches or pull requests

1 participant