【发布时间】:2017-05-22 08:24:49
【问题描述】:
当我将 RN 从 0.32 升级到 0.44 时,对 16.0.0-alpha.6 做出反应。 当我在 Xcode 上操作应用程序时,我得到了错误:
【问题讨论】:
-
同样的问题,你找到解决办法了吗?
-
看看StackOverFlow#45988103,它对我有用。
标签: react-native
当我将 RN 从 0.32 升级到 0.44 时,对 16.0.0-alpha.6 做出反应。 当我在 Xcode 上操作应用程序时,我得到了错误:
【问题讨论】:
标签: react-native
打开你的/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
...
}
为我工作! 来源here
【讨论】: