@@ -157,6 +157,7 @@ function raiseOnErrorEvent(uri, { onError, onLoadEnd }) {
157
157
}
158
158
if ( onLoadEnd ) onLoadEnd ( ) ;
159
159
}
160
+
160
161
function hasSourceDiff ( a : ImageSource , b : ImageSource ) {
161
162
return (
162
163
a . uri !== b . uri || JSON . stringify ( a . headers ) !== JSON . stringify ( b . headers )
@@ -391,25 +392,27 @@ const ImageWithHeaders: ImageComponent = React.forwardRef((props, ref) => {
391
392
} ) ;
392
393
393
394
// $FlowIgnore: This is the correct type, but casting makes it unhappy since the variables aren't defined yet
394
- const Image : ImageComponent & ImageStatics = React . forwardRef ( ( props , ref ) => {
395
- if ( props . source && props . source . headers ) {
396
- return < ImageWithHeaders ref = { ref } { ...props } /> ;
397
- }
395
+ const ImageWithStatics : ImageComponent & ImageStatics = React . forwardRef (
396
+ ( props , ref ) => {
397
+ if ( props . source && props . source . headers ) {
398
+ return < ImageWithHeaders ref = { ref } { ...props } /> ;
399
+ }
398
400
399
- return < BaseImage ref = { ref } { ...props } /> ;
400
- } ) ;
401
+ return < BaseImage ref = { ref } { ...props } /> ;
402
+ }
403
+ ) ;
401
404
402
- Image . displayName = 'Image' ;
405
+ ImageWithStatics . displayName = 'Image' ;
403
406
404
- Image . getSize = function ( uri , success , failure ) {
407
+ ImageWithStatics . getSize = function ( uri , success , failure ) {
405
408
ImageLoader . getSize ( uri , success , failure ) ;
406
409
} ;
407
410
408
- Image . prefetch = function ( uri ) {
411
+ ImageWithStatics . prefetch = function ( uri ) {
409
412
return ImageLoader . prefetch ( uri ) ;
410
413
} ;
411
414
412
- Image . queryCache = function ( uris ) {
415
+ ImageWithStatics . queryCache = function ( uris ) {
413
416
return ImageLoader . queryCache ( uris ) ;
414
417
} ;
415
418
@@ -465,4 +468,4 @@ const resizeModeStyles = StyleSheet.create({
465
468
}
466
469
} ) ;
467
470
468
- export default Image ;
471
+ export default ImageWithStatics ;
0 commit comments