Skip to content

Commit 994ea3b

Browse files
cipolleschireact-native-bot
authored andcommitted
Add missing loadFromSource method in the DefaultRNFactoryDelegate (facebook#49931)
Summary: Pull Request resolved: facebook#49931 This change fixes the app startup in the Old Architecture by implementing the loadSourceForBridge:onProgress:onComplete method in the RCTDefaultReactNativeFactoryDelegate object. The method was missing here, so the Bridge was never trying to load the JS bundle from Metro, resulting in an empty app. ## Changelog: [iOS][Fixed] - Implement the loadSourceForBridge:onProgress:onComplete in the RCTDefaultReactNativeFactoryDelegate. Reviewed By: cortinico Differential Revision: D70898811 fbshipit-source-id: 3e5d519a1965e92ace91ca6d5b316a9069279448
1 parent 31e09bc commit 994ea3b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,11 @@ - (Class)getModuleClassFromName:(const char *)name
118118
return nullptr;
119119
}
120120

121+
- (void)loadSourceForBridge:(RCTBridge *)bridge
122+
onProgress:(RCTSourceLoadProgressBlock)onProgress
123+
onComplete:(RCTSourceLoadBlock)loadCallback
124+
{
125+
[RCTJavaScriptLoader loadBundleAtURL:[self sourceURLForBridge:bridge] onProgress:onProgress onComplete:loadCallback];
126+
}
127+
121128
@end

packages/rn-tester/RNTester/AppDelegate.mm

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,6 @@ - (BOOL)application:(UIApplication *)app
7676
return [RCTLinkingManager application:app openURL:url options:options];
7777
}
7878

79-
- (void)loadSourceForBridge:(RCTBridge *)bridge
80-
onProgress:(RCTSourceLoadProgressBlock)onProgress
81-
onComplete:(RCTSourceLoadBlock)loadCallback
82-
{
83-
[RCTJavaScriptLoader loadBundleAtURL:[self sourceURLForBridge:bridge] onProgress:onProgress onComplete:loadCallback];
84-
}
85-
8679
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
8780
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
8881
{

0 commit comments

Comments
 (0)