[ReactNative] Remove warning for <Image source={require('./image.jpg')} />

Summary:
require('./image.jpg') returns a number and therefore the propType is wrong. Adding it to the propType to fix the warning and dealing with flow which is completely broken for this.
This commit is contained in:
Christopher Chedeau
2015-08-19 21:44:59 -07:00
parent 059e605e49
commit 16ddb1962a
2 changed files with 17 additions and 13 deletions

View File

@@ -60,9 +60,13 @@ var Image = React.createClass({
* could be an http address, a local file path, or the name of a static image
* resource (which should be wrapped in the `require('image!name')` function).
*/
source: PropTypes.shape({
uri: PropTypes.string,
}),
source: PropTypes.oneOfType([
PropTypes.shape({
uri: PropTypes.string,
}),
// Opaque type returned by require('./image.jpg')
PropTypes.number,
]),
/**
* A static image to display while downloading the final image off the
* network.