mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
[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:
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user