Skip to content

Commit

Permalink
Deprecate RCTImageLoader category of RCTBridge [2/N]
Browse files Browse the repository at this point in the history
Summary: We no longer want to access RCTImageLoader from the bridge.

Reviewed By: shergin

Differential Revision: D16389383

fbshipit-source-id: 8e006bf0e2e2651f3ac036c09e589213ac9d29f9
  • Loading branch information
Peter Argany authored and facebook-github-bot committed Jul 24, 2019
1 parent e9af572 commit 8a80d61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Libraries/Image/RCTImageLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,12 @@ typedef dispatch_block_t RCTImageLoaderCancellationBlock;

@end

@interface RCTBridge (RCTImageLoader)

/**
* The shared image loader instance
* DEPRECATED!! DO NOT USE
* Instead use `[_bridge moduleForClass:[RCTImageLoader class]]`
*/
@interface RCTBridge (RCTImageLoader)

@property (nonatomic, readonly) RCTImageLoader *imageLoader;

@end
Expand Down
6 changes: 6 additions & 0 deletions Libraries/Image/RCTImageLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -936,10 +936,16 @@ - (void)cancelRequest:(id)requestToken

@end

/**
* DEPRECATED!! DO NOT USE
* Instead use `[_bridge moduleForClass:[RCTImageLoader class]]`
*/
@implementation RCTBridge (RCTImageLoader)

- (RCTImageLoader *)imageLoader
{
RCTLogWarn(@"Calling bridge.imageLoader is deprecated and will not work in newer versions of RN. Please update to the"
"moduleForClass API or turboModuleLookupDelegate API.");
return [self moduleForClass:[RCTImageLoader class]];
}

Expand Down

0 comments on commit 8a80d61

Please sign in to comment.