【问题标题】:RCTBridge require dispatch_sync to load RCTDevLoadingViewRCTBridge 需要 dispatch_sync 来加载 RCTDevLoadingView
【发布时间】:2020-07-08 08:09:50
【问题描述】:

我正处于 react-native 的学习阶段。当我在模拟器上运行我的应用程序时,我收到以下警告,但如何调试此错误?我不确定在哪里检查以消除此错误,有人可以指导我吗?我在 iOS 模拟器上运行。

【问题讨论】:

标签: react-native react-native-ios


【解决方案1】:

我能够通过更新 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];
  
}

【讨论】:

    猜你喜欢
    • 2018-02-09
    • 1970-01-01
    • 2021-07-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多