File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
packages/core/src/components Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ interface ExtendedImageProps extends ExpoImageProps {
24
24
allowDownscaling ?: boolean ;
25
25
blurRadius ?: number ;
26
26
blurhash ?: string ;
27
+ cacheKey ?: string ;
27
28
}
28
29
29
30
const resizeModeToContentFit = (
@@ -52,9 +53,25 @@ const ExpoImage: React.FC<ExtendedImageProps> = ({
52
53
allowDownscaling = true ,
53
54
blurRadius,
54
55
blurhash,
56
+ cacheKey,
55
57
...props
56
58
} ) => {
57
- const imageSource = source ?? Config . placeholderImageURL ;
59
+ let imageSource = source ?? Config . placeholderImageURL ;
60
+
61
+ if ( cacheKey ) {
62
+ if ( typeof source === "object" && "uri" in source ) {
63
+ imageSource = {
64
+ ...source ,
65
+ cacheKey,
66
+ } ;
67
+ } else if ( typeof source === "string" ) {
68
+ imageSource = {
69
+ uri : source ,
70
+ cacheKey,
71
+ } ;
72
+ }
73
+ }
74
+
58
75
const finalContentFit = resizeMode
59
76
? resizeModeToContentFit ( resizeMode )
60
77
: contentFit ;
You can’t perform that action at this time.
0 commit comments