react-native-cached-image icon indicating copy to clipboard operation
react-native-cached-image copied to clipboard

Support image specific style properties (ex. tintColor)

Open torbjorn-kvist opened this issue 7 years ago • 2 comments

Tested on 1.3.5 and 1.4.0-rc React Native: 0.47

"Warning: Failed prop type: Invalid props.style key tintColor supplied to ActivityIndicator."

Suggested solutions:

  • Image specific style property
  • Omit "tintColor", "resizeMode" etc when setting styles for View and ActivityIndicator

torbjorn-kvist avatar Sep 13 '17 06:09 torbjorn-kvist

@Dvidan Sounds good! If you can create a quick PR for this it would be amazing.

Not sure what's the best way yo go about it tho.. Should we have a whitelist/blacklist for props? Or maybe simply have a higher level props for handling the different components, i.e. containerViewStyles, imageStyles (which could just be style), loadingIndicatorStyles?

Would love to hear some thoughts about it

kfiroo avatar Sep 13 '17 15:09 kfiroo

@kfiroo Not sure either I have gotten it to work by doing _.omit(flattenStyle(style), ['resizeMode', 'tintColor']) for example. Problem with that is if there is going to be a more Image specific style properties, then there is a need to update the omit each time there is something new.

Using higher level props could also work.

One other alternativ is to import http://facebook.github.io/react-native/docs/imagestyleproptypes.html https://facebook.github.io/react-native/docs/viewstyleproptypes.html

And use lodash 'difference' and then omit the image specific values.

torbjorn-kvist avatar Sep 14 '17 05:09 torbjorn-kvist