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

StyleSheet not supported #35

Closed
davidgoli opened this issue Mar 15, 2018 · 2 comments · Fixed by #36
Closed

StyleSheet not supported #35

davidgoli opened this issue Mar 15, 2018 · 2 comments · Fixed by #36

Comments

@davidgoli
Copy link
Contributor

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.

@emjayschoen
Copy link

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'

@alorr10
Copy link

alorr10 commented Aug 6, 2018

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), ]),

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

Successfully merging a pull request may close this issue.

3 participants