[Image] Fix default Image functionality

Summary:
In the latest 0.9.0-rc of React Native, the default image won't load due to a typo and a missing condition in `setImage`. This PR contains fixes for both of them.
Closes https://github.com/facebook/react-native/pull/2269
Github Author: Tom Hastjarjanto <tom@intellicode.nl>
This commit is contained in:
Tom Hastjarjanto 2015-08-11 04:29:55 -07:00
parent f5d8e4d6e0
commit 2424a215e0
2 changed files with 3 additions and 2 deletions

View File

@ -173,7 +173,7 @@ var Image = React.createClass({
resizeMode={resizeMode}
tintColor={tintColor}
src={source.uri}
defaultSrc={defaultSource.uri}
defaultImageSrc={defaultSource.uri}
/>
);
}

View File

@ -69,8 +69,9 @@ RCT_NOT_IMPLEMENTED(-init)
- (void)setImage:(UIImage *)image
{
image = image ?: _defaultImage;
if (image != super.image) {
super.image = image ?: _defaultImage;
super.image = image;
[self _updateImage];
}
}