注意:请确保评论我要提到的改进该问题的内容,而不是用拇指写下来,我能够为另一个项目成功地通过expo设置React Navigation,并希望在该项目中启动并运行RNN。
我正在为我的React Native应用(特别是使用Xcode的iOS)设置React Native Navigation。
我已AppDelegate.m
按照指示更改了文件:
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <ReactNativeNavigation/ReactNativeNavigation.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
[ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions];
return YES;
}
@end
进行更改后,我收到两个Xcode错误:
'ReactNativeNavigation/ReactNativeNavigation.h' file not found
Use of undeclared identifier 'ReactNativeNavigation'
我已经确保按照所有步骤操作,该错误发生在React Native Navigation iOS文档的步骤3中
尝试删除node_modules文件夹,然后在项目目录中进行全新的npm安装或yarn安装。接下来,运行react-native链接。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句