From a454e4201b8e9f24d9d3f7ca4e4cd9740ef0dfab Mon Sep 17 00:00:00 2001 From: Blair Vanderhoof Date: Thu, 9 Apr 2015 21:21:37 -0700 Subject: [PATCH] Warn for width/height props If the user passes in a width or height prop to the Image component, warn them that they should set these values using style instead. --- Libraries/Image/Image.ios.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index 5f3dfdd986a0cd..0340b4e88c0d01 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -119,6 +119,11 @@ var Image = React.createClass({ if (this.props.style && this.props.style.tintColor) { warning(RawImage === RCTStaticImage, 'tintColor style only supported on static images.'); } + + warning( + this.props.width === undefined && this.props.height === undefined, + 'Width and height props are not supported. Please set them using a style instead.' + ); var contentModes = NativeModules.UIManager.UIView.ContentMode; var resizeMode;