Skip to content

Commit a26da7b

Browse files
fix(0.78): Add missing loadFromSource method in the DefaultRNFactoryDelegate (#2437)
## Summary: Cherry pick facebook@8b33668 to fix an issue where new apps made with the old architecture never call metro and therefore show a blank screen. ## Test Plan: Tested on a new app using `@react-native-community/cli init && react-native-macos-init` Co-authored-by: Riccardo Cipolleschi <[email protected]>
1 parent d0edc81 commit a26da7b

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
@@ -122,4 +122,11 @@ - (Class)getModuleClassFromName:(const char *)name
122122
return nullptr;
123123
}
124124

125+
- (void)loadSourceForBridge:(RCTBridge *)bridge
126+
onProgress:(RCTSourceLoadProgressBlock)onProgress
127+
onComplete:(RCTSourceLoadBlock)loadCallback
128+
{
129+
[RCTJavaScriptLoader loadBundleAtURL:[self sourceURLForBridge:bridge] onProgress:onProgress onComplete:loadCallback];
130+
}
131+
125132
@end

packages/rn-tester/RNTester/AppDelegate.mm

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,6 @@ - (BOOL)application:(UIApplication *)app
9090
}
9191
#endif // [macOS]
9292

93-
- (void)loadSourceForBridge:(RCTBridge *)bridge
94-
onProgress:(RCTSourceLoadProgressBlock)onProgress
95-
onComplete:(RCTSourceLoadBlock)loadCallback
96-
{
97-
[RCTJavaScriptLoader loadBundleAtURL:[self sourceURLForBridge:bridge] onProgress:onProgress onComplete:loadCallback];
98-
}
99-
10093
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
10194
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
10295
{

0 commit comments

Comments
 (0)