i follow the medium article: React Native 0.63 Monorepo walkthrough carefully to get yarn workspaces works with react-native. Everhtings works, i can build my iOS und Android App and also the Metro Bundler works, but i get the following warning from the metro bundler when i build my iOS App with yarn workspace mobile ios
RCTBridge required dispatch_sync to load RCTDevLoadingView. This may lead to deadlocks
I don't get this warning unless I use react-native with yarn workspaces. Therefore, I suspect that the error is generated by my monorepo setup.
Do you have any idea how I can remove this warning?
Open Your /ios/YourAppName/AppDelegate.m
#import "AppDelegate.h"
// ADD THIS
#if RCT_DEV
#import <React/RCTDevLoadingView.h>
#endif
// TILL HERE
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocation
moduleProvider:nil
launchOptions:launchOptions];
// THIS CONDITION
#if RCT_DEV
[bridge moduleForClass:[RCTDevLoadingView class]];
#endif
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"Test"
initialProperties:nil];
// TILL HERE
...
}
source here
Initially open ./ios/{YourAppName}/AppDelegate.m
and add the following after the #import "AppDelegate.h"
#if RCT_DEV #import <React/RCTDevLoadingView.h> #endif
Then in the @implementation AppDelegate
before the RCTRootView *rootView = ....
add the following
#if RCT_DEV
[bridge moduleForClass:[RCTDevLoadingView class]];
#endif
Finally, reopen the terminal and yarn run ios
or npm run ios
again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With