Note:请务必评论我应该提到的内容来改进这个问题,而不是否定,我能够成功地为另一个项目设置 React Navigation 和 expo,并且很乐意在这个项目中启动并运行 RNN。
我正在为我的 React Native 应用程序(特别是使用 Xcode 的 iOS)设置 React Native 导航。
我已经改变了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'
我已确保遵循所有步骤,错误发生在步骤 3 中React Native 导航 iOS 文档 https://wix.github.io/react-native-navigation/#/docs/Installing?id=ios
尝试删除node_modules文件夹,然后在项目目录中执行新的npm安装或yarn安装。接下来运行react-native链接。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)