xamous / react-native-smooth-pincode-input

A cross-platform, smooth, lightweight, customizable PIN code input component for React Native.
MIT License
395 stars 137 forks source link

Error after upgrading to Expo 51 ( cannot read property style) #114

Open Serranosoft opened 1 month ago

Serranosoft commented 1 month ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-smooth-pincode-input@1.0.9 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-smooth-pincode-input/src/index.js b/node_modules/react-native-smooth-pincode-input/src/index.js
index 0a00f22..4bd63b8 100644
--- a/node_modules/react-native-smooth-pincode-input/src/index.js
+++ b/node_modules/react-native-smooth-pincode-input/src/index.js
@@ -6,9 +6,9 @@ import {
   TextInput,
   StyleSheet,
   I18nManager,
-  ViewPropTypes,
 } from 'react-native';
 import * as Animatable from 'react-native-animatable';
+import { ViewPropTypes } from 'deprecated-react-native-prop-types';

 const styles = StyleSheet.create({
   containerDefault: {},
@@ -265,52 +265,4 @@ class SmoothPinCodeInput extends Component {
   };
 }

-SmoothPinCodeInput.propTypes = {
-  value: PropTypes.string,
-  codeLength: PropTypes.number,
-  cellSize: PropTypes.number,
-  cellSpacing: PropTypes.number,
-
-  placeholder: PropTypes.oneOfType([
-    PropTypes.string,
-    PropTypes.element,
-  ]),
-  mask: PropTypes.oneOfType([
-    PropTypes.string,
-    PropTypes.element,
-  ]),
-  maskDelay: PropTypes.number,
-  password: PropTypes.bool,
-
-  autoFocus: PropTypes.bool,
-
-  restrictToNumbers: PropTypes.bool,
-
-  containerStyle: ViewPropTypes.style,
-
-  cellStyle: ViewPropTypes.style,
-  cellStyleFocused: ViewPropTypes.style,
-  cellStyleFilled: ViewPropTypes.style,
-
-  textStyle: Text.propTypes.style,
-  textStyleFocused: Text.propTypes.style,
-
-  animated: PropTypes.bool,
-  animationFocused: PropTypes.oneOfType([
-    PropTypes.string,
-    PropTypes.object,
-  ]),
-
-  onFulfill: PropTypes.func,
-  onChangeText: PropTypes.func,
-  onBackspace: PropTypes.func,
-  onTextChange: PropTypes.func,
-  testID: PropTypes.any,
-  onFocus: PropTypes.func,
-  onBlur: PropTypes.func,
-  keyboardType: PropTypes.string,
-  editable: PropTypes.bool,
-  inputProps: PropTypes.exact(TextInput.propTypes),
-};
-
 export default SmoothPinCodeInput;

This issue body was partially generated by patch-package.