From 18e6094cabb82a5ae2110158f015ee2ea9ccc440 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 27 Jul 2015 10:49:43 -0700 Subject: [PATCH] [ReactNative] Add overflow to the whitelisted Image props Summary: For some reason we're now spamming the logs everytime we render an Image because overflow is not defined in the whitelist. overflow: 'hidden' is needed for network images with cover mode. The way we currently define those is not optimal where we try to factor as many things as possible into distinct propTypes. However for Text we're not even using this but we are getting all the ones from View (which many do not apply) and remove some that aren't needed. It may be useful to cleanup this in the future but in the short term, it's better to remove this warning that doesn't have much value anyway. --- Libraries/Image/ImageStylePropTypes.js | 1 + Libraries/StyleSheet/StyleSheetValidation.js | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Libraries/Image/ImageStylePropTypes.js b/Libraries/Image/ImageStylePropTypes.js index c70bee73a..c4ccfb578 100644 --- a/Libraries/Image/ImageStylePropTypes.js +++ b/Libraries/Image/ImageStylePropTypes.js @@ -24,6 +24,7 @@ var ImageStylePropTypes = { borderColor: ReactPropTypes.string, borderWidth: ReactPropTypes.number, borderRadius: ReactPropTypes.number, + overflow: ReactPropTypes.oneOf(['visible', 'hidden']), // iOS-Specific style to "tint" an image. // It changes the color of all the non-transparent pixels to the tintColor diff --git a/Libraries/StyleSheet/StyleSheetValidation.js b/Libraries/StyleSheet/StyleSheetValidation.js index be59b2ec5..f61decb3c 100644 --- a/Libraries/StyleSheet/StyleSheetValidation.js +++ b/Libraries/StyleSheet/StyleSheetValidation.js @@ -51,11 +51,6 @@ class StyleSheetValidation { static addValidStylePropTypes(stylePropTypes) { for (var key in stylePropTypes) { - invariant( - allStylePropTypes[key] === undefined || - allStylePropTypes[key] === stylePropTypes[key], - 'Attemped to redefine existing style prop type "' + key + '".' - ); allStylePropTypes[key] = stylePropTypes[key]; } }