React Native:更新到0.60后无法导入React标头 [英] React Native: Unable to import React headers after updating to 0.60
本文介绍了React Native:更新到0.60后无法导入React标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
更新为React Native 0.60
后,标头链接不再起作用.
After updating to React Native 0.60
the header linking does no longer work.
在构建期间从React library
链接时遇到问题:
I'm having problems linking from the React library
during build:
/Users/User/Developer/Project/node_modules/react-native-image-resizer/ios/RCTImageResizer/RCTImageResizer.m:12:9: fatal error: 'React/RCTImageLoader.h' file not found
#import <React/RCTImageLoader.h>
^~~~~~~~~~~~~~~~~~~~~~~~
0.60
中的更改:
- 文件
RCTImageLoader.h
现在位于/node_modules/react-native/React/CoreModules
. - 包含这些标头的文件
React.xcodeproj
不再存在
- The file
RCTImageLoader.h
is now at/node_modules/react-native/React/CoreModules
. - The file
React.xcodeproj
that contained these headers is no longer present
推荐答案
有 React Native 0.60中的许多更改,主要变化之一是React模块现在使用CocoaPods打包,从而取代了标头链接.
There were many changes in React Native 0.60, one of the main ones is that React modules are now packaged using CocoaPods, which replaces header linking.
我建议您在0.60+版本中生成一个新项目,并检查其项目结构(主要是Podfile
).您还可以使用升级助手来查看已更改的内容.
I recommend you generate a new project in 0.60+ and check out its project structure (mainly the Podfile
). You can also use the upgrade helper to see what's changed.
这篇关于React Native:更新到0.60后无法导入React标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文