diff --git a/packages/react-native/Libraries/Image/RCTImageLoader.mm b/packages/react-native/Libraries/Image/RCTImageLoader.mm index 68a12d351227ef..6b3efbe7473dd1 100644 --- a/packages/react-native/Libraries/Image/RCTImageLoader.mm +++ b/packages/react-native/Libraries/Image/RCTImageLoader.mm @@ -10,6 +10,7 @@ #import #import +#import #import #import @@ -1222,7 +1223,12 @@ - (void)cancelRequest:(id)requestToken : (RCTPromiseResolveBlock)resolve reject : (RCTPromiseRejectBlock)reject) { - [self prefetchImageWithMetadata:uri queryRootName:nil rootTag:0 resolve:resolve reject:reject]; + NSURL *URL = [RCTConvert NSURL:uri]; + [SDWebImagePrefetcher.sharedImagePrefetcher prefetchURLs:@[ URL ] + progress:nil + completed:^(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls) { + resolve(@YES); + }]; } RCT_EXPORT_METHOD(prefetchImageWithMetadata