7

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.

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'
  ]

My question is how can I work out which subspecs are necessary and why?

Also hoping the answer to this will give me a better understanding of what's going on when I use subspecs.

geisterfurz007
  • 5,292
  • 5
  • 33
  • 54
deworde
  • 2,679
  • 5
  • 32
  • 60

1 Answers1

-1

Is it really necessary to trim out the unnecessary ones?

I just went with

pod 'React', :path => '../node_modules/react-native'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
Antoine
  • 5,504
  • 5
  • 33
  • 54