react-native-global-props icon indicating copy to clipboard operation
react-native-global-props copied to clipboard

Need to check if "style" prop is an array

Open thomasttvo opened this issue 7 years ago • 5 comments

this.props = { ...this.props, style: [customProps.style, this.props.style] };

when this.props.style is an array, this will not work properly. In my case, it ignores customProps.style

thomasttvo avatar Apr 30 '18 06:04 thomasttvo

Yes. Need to check for both customProps.style and this.props.style.

mahesh1996 avatar May 01 '18 08:05 mahesh1996

@mahesh1996 while you're at it, can you take a look at https://github.com/Ajackster/react-native-global-props/issues/10 ? I suspect they're related. Thank you!

thomasttvo avatar May 01 '18 08:05 thomasttvo

@thomasttvo Tested on react-native 0.51. It works fine as Text can accept style object or recursive array of style objects.

mahesh1996 avatar May 01 '18 10:05 mahesh1996

@mahesh1996 I got it on some elements too, but have deleted the code, will let you know if I happen to reproduce it.

thomasttvo avatar May 01 '18 10:05 thomasttvo

Also, make sure If you are using native-base in your project, then Text is imported from react-native.

mahesh1996 avatar May 01 '18 10:05 mahesh1996