mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix RNTester networking conversion to TurboModule (#27218)
Summary: Now that the networking module is a TurboModule request handlers need to be passed at module creation. The code was missing for RNTester. ## Changelog [Internal] [Fixed] - Fix RNTester networking conversion to TurboModule Pull Request resolved: https://github.com/facebook/react-native/pull/27218 Test Plan: Tested that RNTester XMLHttpRequest example now works on iOS Differential Revision: D18506038 Pulled By: RSNara fbshipit-source-id: cd88319e386c7b7b6e11cfb920f2ceb761a4136a
This commit is contained in:
committed by
Facebook Github Bot
parent
dc0ec22e79
commit
ec59e60d45
@@ -16,6 +16,10 @@
|
||||
#import <React/RCTImageLoader.h>
|
||||
#import <React/RCTLocalAssetImageLoader.h>
|
||||
#import <React/RCTGIFImageDecoder.h>
|
||||
#import <React/RCTNetworking.h>
|
||||
#import <React/RCTHTTPRequestHandler.h>
|
||||
#import <React/RCTDataRequestHandler.h>
|
||||
#import <React/RCTFileRequestHandler.h>
|
||||
#import <React/RCTRootView.h>
|
||||
|
||||
#import <cxxreact/JSExecutor.h>
|
||||
@@ -151,6 +155,14 @@
|
||||
} decodersProvider:^NSArray<id<RCTImageDataDecoder>> *{
|
||||
return @[[RCTGIFImageDecoder new]];
|
||||
}];
|
||||
} else if (moduleClass == RCTNetworking.class) {
|
||||
return [[moduleClass alloc] initWithHandlersProvider:^NSArray<id<RCTURLRequestHandler>> *{
|
||||
return @[
|
||||
[RCTHTTPRequestHandler new],
|
||||
[RCTDataRequestHandler new],
|
||||
[RCTFileRequestHandler new],
|
||||
];
|
||||
}];
|
||||
}
|
||||
// No custom initializer here.
|
||||
return [moduleClass new];
|
||||
|
||||
Reference in New Issue
Block a user