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:
Janic Duplessis
2019-11-14 10:43:18 -08:00
committed by Facebook Github Bot
parent dc0ec22e79
commit ec59e60d45
+12
View File
@@ -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];