Skip to content

Commit 7c6f58e

Browse files
committed
Move variables to original locations
1 parent 26c1ae9 commit 7c6f58e

File tree

1 file changed

+4
-5
lines changed
  • packages/react-native-web/src/exports/Image

1 file changed

+4
-5
lines changed

packages/react-native-web/src/exports/Image/index.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,12 @@ const Image: React.AbstractComponent<
212212
}
213213
}
214214

215-
// Don't raise load events from the fallback source
215+
// Don't raise load events for the fallback source
216216
const fallbackSource = useSource({ onError }, defaultSource);
217217
const mainSource = useSource(
218218
{ onLoad, onLoadStart, onLoadEnd, onError },
219219
source
220220
);
221-
const availableSource = getSourceToDisplay(mainSource, fallbackSource);
222-
const displayImageUri = ImageLoader.resolveUri(availableSource.uri);
223-
const imageSizeStyle = resolveAssetDimensions(availableSource);
224-
225221
const [layout, updateLayout] = React.useState({});
226222
const hasTextAncestor = React.useContext(TextAncestorContext);
227223
const hiddenImageRef = React.useRef(null);
@@ -232,6 +228,9 @@ const Image: React.AbstractComponent<
232228
filterRef.current
233229
);
234230
const resizeMode = props.resizeMode || _resizeMode || 'cover';
231+
const availableSource = getSourceToDisplay(mainSource, fallbackSource);
232+
const displayImageUri = ImageLoader.resolveUri(availableSource.uri);
233+
const imageSizeStyle = resolveAssetDimensions(availableSource);
235234
const backgroundImage = displayImageUri ? `url("${displayImageUri}")` : null;
236235
const backgroundSize = getBackgroundSize();
237236

0 commit comments

Comments
 (0)