adding error message including stacktrace and example

Reviewed By: fkgozali

Differential Revision: D5908789

fbshipit-source-id: 061e414d5105df607b7dcafefb134ad9c94a9a71
This commit is contained in:
David Vacca
2017-09-25 21:55:56 -07:00
committed by Facebook Github Bot
parent 29e7659111
commit b694f96762
3 changed files with 24 additions and 1 deletions

View File

@@ -272,6 +272,10 @@ var Image = createReactClass({
console.warn('The <Image> component requires a `source` property rather than `src`.');
}
if (this.props.children) {
throw new Error('The <Image> component cannot contain children. If you want to render content on top of the image, consider using aboslute positioning.');
}
if (source && (source.uri || Array.isArray(source))) {
let style;
let sources;