Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RCTBridge require dispatch_sync to load RCTDevLoadingView

I am in my learning phase of react-native. When I run my app on simulator, I get the following warning, but how to debug this error? I am not sure what and where to check to get rid of this error, could someone please guide me a bit? I am running on iOS simulator.

enter image description here

like image 942
Leem.fin Avatar asked Jul 08 '20 08:07

Leem.fin


1 Answers

I was able to workaround the warning by updating AppDelegate.m

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

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  ...
  RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocation
                                            moduleProvider:nil
                                             launchOptions:launchOptions];
#if RCT_DEV
  [bridge moduleForClass:[RCTDevLoadingView class]];
#endif
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"Test"
                                            initialProperties:nil];
  
}

like image 118
Muhammad Numan Avatar answered Oct 31 '22 18:10

Muhammad Numan