How can I know which React Native pod subspecs to add?
Asked Answered
H

0

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.

Hypothalamus answered 12/10, 2018 at 9:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.