Skip to content

Commit

Permalink
Address RCTLog console warning
Browse files Browse the repository at this point in the history
RCTBridge required dispatch_sync to load RCTDevLoadingView. This may lead to deadlocks

facebook/react-native#16376
  • Loading branch information
leotm committed Jul 17, 2021
1 parent a8a81f4 commit 0b67d61
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ios/MyApp/AppDelegate.m
@@ -1,5 +1,9 @@
#import "AppDelegate.h"

#if RCT_DEV
#import <React/RCTDevLoadingView.h>
#endif

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
Expand Down Expand Up @@ -34,6 +38,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
#endif

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];

#if RCT_DEV
[bridge moduleForClass:[RCTDevLoadingView class]];
#endif

RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"MyApp"
initialProperties:nil];
Expand Down

0 comments on commit 0b67d61

Please sign in to comment.