[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:
parent
f5d8e4d6e0
commit
2424a215e0
|
@ -173,7 +173,7 @@ var Image = React.createClass({
|
|||
resizeMode={resizeMode}
|
||||
tintColor={tintColor}
|
||||
src={source.uri}
|
||||
defaultSrc={defaultSource.uri}
|
||||
defaultImageSrc={defaultSource.uri}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue