react-native链接有什么作用? https://github.com/react-native-community/react-native-svg doc说要做 react-native link react-native-svg 它是一样的吗? pod 'RNSVG', :path = '../node_modules/react-native-svg' # pod install Coco
https://github.com/react-native-community/react-native-svg doc说要做
react-native link react-native-svg
它是一样的吗?
pod 'RNSVG', :path => '../node_modules/react-native-svg' # pod installCocoapods是iOS的依赖管理器.就像npm用于JavaScript(更具体地说是Node.js)项目一样.
让我们切换示例以使用react-native-device-info.
项目要求您创建或添加以下内容到Podfile(如果您手动链接).
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
这将添加RNDeviceInfo作为iOS依赖项,并将查看’../node_modules/react-native-device-info’以获取它.更具体地说,它将查找.podspec文件.
如果你看看.podspec文件,你会看到类似的东西
s.source_files =“RNDeviceInfo / *.{h,m}”.所有文件都将获取匹配的源(RNDeviceInfo.h和RNDeviceInfo.m)并将它们存储在RNDeviceInfo目录中.我想(总猜),目录名与s.name匹配.
react-native链接…自动地有效地做同样的事情.我引用了React文档:
Link your native dependencies: react-native link
Done! All libraries with native dependencies should be successfully linked to your iOS/Android project.
两者都实现了相同的结果,使用react-native链接将自动链接本机库.