Closed davidgoli closed 5 years ago
This should also allow an array of styles e.g. textStyle={[Styles.textStyle, Styles.customStyle]}
, which gives me the warning: Warning: Failed prop type: Invalid prop 'textStyle' of type 'array' supplied to 'PhoneInput', expected 'object'
Using this line as the PropType for style and textStyle is working for me:
PropTypes.oneOfType([ PropTypes.object, PropTypes.number, PropTypes.arrayOf(PropTypes.object), PropTypes.arrayOf(PropTypes.number), ]),
I'm using ReactNative's
StyleSheet
to build styles, https://facebook.github.io/react-native/docs/stylesheet.html, which convert style objects into numerical ids that are used to look up the style from a global stylesheet. When using with this library, the styles are passed along just fine, but I get a warning:Warning: Failed prop type: Invalid prop 'textStyle' of type 'number' supplied to 'PhoneInput', expected 'object'
.This should be a fairly trivial fix, just updating the PropTypes to expect a number or an object should do the trick and get rid of the warning.