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 {
2424 allowDownscaling ?: boolean ;
2525 blurRadius ?: number ;
2626 blurhash ?: string ;
27+ cacheKey ?: string ;
2728}
2829
2930const resizeModeToContentFit = (
@@ -52,9 +53,25 @@ const ExpoImage: React.FC<ExtendedImageProps> = ({
5253 allowDownscaling = true ,
5354 blurRadius,
5455 blurhash,
56+ cacheKey,
5557 ...props
5658} ) => {
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+
5875 const finalContentFit = resizeMode
5976 ? resizeModeToContentFit ( resizeMode )
6077 : contentFit ;
You can’t perform that action at this time.
0 commit comments