Skip to content

Commit

Permalink
Move variables to original locations
Browse files Browse the repository at this point in the history
  • Loading branch information
kidroca committed Jan 4, 2023
1 parent 26c1ae9 commit 7c6f58e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/react-native-web/src/exports/Image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,12 @@ const Image: React.AbstractComponent<
}
}

// Don't raise load events from the fallback source
// Don't raise load events for the fallback source
const fallbackSource = useSource({ onError }, defaultSource);
const mainSource = useSource(
{ onLoad, onLoadStart, onLoadEnd, onError },
source
);
const availableSource = getSourceToDisplay(mainSource, fallbackSource);
const displayImageUri = ImageLoader.resolveUri(availableSource.uri);
const imageSizeStyle = resolveAssetDimensions(availableSource);

const [layout, updateLayout] = React.useState({});
const hasTextAncestor = React.useContext(TextAncestorContext);
const hiddenImageRef = React.useRef(null);
Expand All @@ -232,6 +228,9 @@ const Image: React.AbstractComponent<
filterRef.current
);
const resizeMode = props.resizeMode || _resizeMode || 'cover';
const availableSource = getSourceToDisplay(mainSource, fallbackSource);
const displayImageUri = ImageLoader.resolveUri(availableSource.uri);
const imageSizeStyle = resolveAssetDimensions(availableSource);
const backgroundImage = displayImageUri ? `url("${displayImageUri}")` : null;
const backgroundSize = getBackgroundSize();

Expand Down

0 comments on commit 7c6f58e

Please sign in to comment.