我怎么知道要添加哪些React Native pod子规格? [英] How can I know which React Native pod subspecs to add?
问题描述
在需要将react-native-device-info
程序包添加到我的iOS系统的问题上,我不得不在我的Podfile中添加对React的依赖.
Working on an issue where I needed to add the react-native-device-info
package to my iOS system, I had to add a dependency on React into my Podfile.
最初,我从网上找到的列表中应用了所有podspec:
Initially I applied all the podspecs from a list I'd found on the net:
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'DevSupport',
'Core',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket'
]
但是我意识到其中一些可能是不必要的,并且通过反复试验将其缩减为:
But I realised that some of those would likely be unnecessary, and via trial and error whittled it down to:
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'DevSupport',
'Core',
'RCTAnimation',
'RCTImage',
'RCTLinkingIOS',
'RCTSettings',
'RCTText'
]
我的问题是如何确定需要哪些子规格以及为什么?
也希望得到答案,这将使我对使用子规范时发生的事情有更好的了解.
Also hoping the answer to this will give me a better understanding of what's going on when I use subspecs.
推荐答案
真的有必要修剪掉不必要的东西吗?
Is it really necessary to trim out the unnecessary ones?
我刚和
pod 'React', :path => '../node_modules/react-native'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
这篇关于我怎么知道要添加哪些React Native pod子规格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!