From ec59e60d452c8246dc2de7252ba2073dced0fdc0 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Thu, 14 Nov 2019 10:36:12 -0800 Subject: [PATCH] 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 --- RNTester/RNTester/AppDelegate.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/RNTester/RNTester/AppDelegate.mm b/RNTester/RNTester/AppDelegate.mm index 471ec564736..2819b4a42f1 100644 --- a/RNTester/RNTester/AppDelegate.mm +++ b/RNTester/RNTester/AppDelegate.mm @@ -16,6 +16,10 @@ #import #import #import +#import +#import +#import +#import #import #import @@ -151,6 +155,14 @@ } decodersProvider:^NSArray> *{ return @[[RCTGIFImageDecoder new]]; }]; + } else if (moduleClass == RCTNetworking.class) { + return [[moduleClass alloc] initWithHandlersProvider:^NSArray> *{ + return @[ + [RCTHTTPRequestHandler new], + [RCTDataRequestHandler new], + [RCTFileRequestHandler new], + ]; + }]; } // No custom initializer here. return [moduleClass new];