From 44c16499fdc4665298f6c88b9ffee626fa1fc969 Mon Sep 17 00:00:00 2001 From: Nathan Brown Date: Sat, 18 Nov 2017 17:15:24 -0800 Subject: [PATCH] Mention when error is thrown Summary: Improve the error message shown when you try to nest components in an `` component by referencing the `` component. It would be helpful if the error message displayed when you try to nest components in an `` component mentioned the `` component. Especially since this component is not yet well documented. [IOS][MINOR][Libraries/Image/Image.ios.js] - Surfaced `` in error message [ANDROID][MINOR][Libraries/Image/Image.android.js] - Surfaced `` in error message Closes https://github.com/facebook/react-native/pull/16880 Differential Revision: D6369396 Pulled By: shergin fbshipit-source-id: c4ae4dbb77d0fce6cbd7a42d1957d16112b24549 --- Libraries/Image/Image.android.js | 2 +- Libraries/Image/Image.ios.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Image/Image.android.js b/Libraries/Image/Image.android.js index d01697946..bdea83b20 100644 --- a/Libraries/Image/Image.android.js +++ b/Libraries/Image/Image.android.js @@ -274,7 +274,7 @@ var Image = createReactClass({ } if (this.props.children) { - throw new Error('The component cannot contain children. If you want to render content on top of the image, consider using absolute positioning.'); + throw new Error('The component cannot contain children. If you want to render content on top of the image, consider using the component or absolute positioning.'); } if (source && (source.uri || Array.isArray(source))) { diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index cc7aeec42..a9c4a8f8f 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -374,7 +374,7 @@ const Image = createReactClass({ } if (this.props.children) { - throw new Error('The component cannot contain children. If you want to render content on top of the image, consider using absolute positioning.'); + throw new Error('The component cannot contain children. If you want to render content on top of the image, consider using the component or absolute positioning.'); } return (