mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Reverting image source null so the fix can go all once later
Summary: Image source null which is in RC D8628053 has a bug which has a fix but didn't make to RC. Reverting so it can be cleaned up before going in RC. Reviewed By: achen1 Differential Revision: D8751687 fbshipit-source-id: e08b23a031455be23047880871813bdc840542dd
This commit is contained in:
committed by
Facebook Github Bot
parent
6292e2707a
commit
816d302e98
@@ -190,6 +190,9 @@ let Image = (
|
||||
props.loadingIndicatorSource,
|
||||
);
|
||||
|
||||
// As opposed to the ios version, here we render `null` when there is no source, source.uri
|
||||
// or source array.
|
||||
|
||||
if (source && source.uri === '') {
|
||||
console.warn('source.uri should not be an empty string');
|
||||
}
|
||||
@@ -212,13 +215,13 @@ let Image = (
|
||||
);
|
||||
}
|
||||
|
||||
if (source && !source?.uri && !Array.isArray(source)) {
|
||||
if (!source || (!source.uri && !Array.isArray(source))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let style;
|
||||
let sources;
|
||||
if (source?.uri != null) {
|
||||
if (source.uri) {
|
||||
const {width, height} = source;
|
||||
style = flattenStyle([{width, height}, styles.base, props.style]);
|
||||
sources = [{uri: source.uri}];
|
||||
@@ -232,7 +235,7 @@ let Image = (
|
||||
style,
|
||||
shouldNotifyLoadEvents: !!(onLoadStart || onLoad || onLoadEnd || onError),
|
||||
src: sources,
|
||||
headers: source?.headers,
|
||||
headers: source.headers,
|
||||
defaultSrc: defaultSource ? defaultSource.uri : null,
|
||||
loadingIndicatorSrc: loadingIndicatorSource
|
||||
? loadingIndicatorSource.uri
|
||||
|
||||
Reference in New Issue
Block a user