Skip to content

Commit a356985

Browse files
committed
Image - resolveBlobUri should be used on the hidden image
`resolveBlobUri` causes difficulties for the logic that identifies resolved source changes It is not necessary to be applied there, but only on the hidden image
1 parent f0e6cc8 commit a356985

File tree

1 file changed

+3
-8
lines changed
  • packages/react-native-web/src/exports/Image

1 file changed

+3
-8
lines changed

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ function resolveSource(source: ?Source): ImageSource {
124124
const match = resolvedSource.uri.match(svgDataUriPattern);
125125
if (match) {
126126
resolvedSource = resolveSvgDataUriSource(resolvedSource, match);
127-
} else {
128-
resolvedSource = resolveBlobUri(resolvedSource);
129127
}
130128
}
131129

@@ -181,11 +179,8 @@ function resolveSvgDataUriSource(
181179
}
182180

183181
// resolve any URI that might have a local blob URL create by `createObjectURL`
184-
function resolveBlobUri(source: ImageSource): ImageSource {
185-
return {
186-
...source,
187-
uri: ImageLoader.resolveBlobUri(source.uri) || source.uri
188-
};
182+
function resolveBlobUri(source: ImageSource): string {
183+
return ImageLoader.resolveBlobUri(source.uri);
189184
}
190185

191186
function getSourceToDisplay(main, fallback) {
@@ -245,7 +240,7 @@ const Image: React.AbstractComponent<
245240
const fallbackSource = useSource(imageLoadingProps, defaultSource);
246241
const mainSource = useSource(imageLoadingProps, source);
247242
const availableSource = getSourceToDisplay(mainSource, fallbackSource);
248-
const displayImageUri = availableSource.uri;
243+
const displayImageUri = resolveBlobUri(availableSource);
249244
const imageSizeStyle = resolveAssetDimensions(availableSource);
250245

251246
const [layout, updateLayout] = React.useState({});

0 commit comments

Comments
 (0)