What does react-native link do?
https://github.com/react-native-community/react-native-svg doc says to do
react-native link react-native-svg
is it the same as
pod 'RNSVG', :path => '../node_modules/react-native-svg'
# pod install
What does react-native link do?
https://github.com/react-native-community/react-native-svg doc says to do
react-native link react-native-svg
is it the same as
pod 'RNSVG', :path => '../node_modules/react-native-svg'
# pod install
Just like this answer said, react-native link add your dependencies in cocoapods Podfile for you automatically, if your ios project used cocoapods.
But it is not like this before react-native v0.50.0. It wrote dependencies' info ( file reference, header search path, library) into your project's xcodeproj directly. You still can see the old code in react-native v0.57.
So, why uses cocoapods?
I guess it's for consistent package management. Without cocoapods, if your dependency, named A, is dependent on another popular module B from iOS communtity , the author of A would need to write some script like install-B.sh to download B's files, or even worse add B into A project directly.
See ios-install-third-party.sh in react-native v0.48 for example.
Also, your iOS development colleagues would like to use cocoapods(rather than xcodeproj). It is important to use the same package manager for javascript developers and iOS developers. Both you know all native modules that your project includes.
react-native link with cocoapods can let we leverage the two communities.