javascript - 未找到 <React/RCTDefines.h> 文件

标签 javascript ios reactjs react-native cocoapods

我正在使用 cocoapods 安装 React Native 和 React。我只想使用一个有 cocoapods 安装的 toast 组件(https://www.npmjs.com/package/react-native-simple-toast)。当我安装并运行该应用程序时,出现错误“”文件未找到错误。 我已经添加了标题搜索路径,但仍然出现此错误。 1)错误 enter image description here

2)react-native-simple-toast xcode工程Header搜索路径 enter image description here

3)主项目Header搜索路径 enter image description here

最佳答案

尝试以下解决方案-

#if __has_include("RCTDefines.h")
  #import "RCTDefines.h"
#else
 #import <React/RCTDefines.h>
#endif

这对我有用。

关于javascript - 未找到 <React/RCTDefines.h> 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46738300/

相关文章:

javascript - 如何使用 React 创建 typescript 装饰器

javascript - Angular 2 - MEAN MongoDB NodeJS

javascript - 使用nodejs添加对象数组并在file.txt上读取它

ios - SwiftyJSON.JSON 到 [字符串 : AnyObject]

ios - UITableViewCell 字体大小不变

iphone - 方向iOS Storyboard不旋转?

javascript - 在 react 中打开一个新图像 onclick

javascript - document.location.reload(true) 在 chrome 中取消

javascript - 如何只在移动设备上运行jquery代码?

reactjs - 如何在 React.js 中传递项目数组