1

I have integrated react native inside existing app, which is done without a problem. Added local Images in my react code which is working as usual in Android but not showing up in iOS (neither simulator nor device). Here is my code

 <TouchableHighlight
key={j + 3000}
style={{ width: 24, height: 24, paddingLeft: 5, paddingTop: 2 }}
onPress={() => this._showAlert(textItem.popText)}
>
<Image
    style={{ width: 13, height: 13, opacity: 0.7 }}
    source={require("./img/info.png")}
   />
</TouchableHighlight>;

Can anyone please suggest what Im doing wrong here. It seems react can find image as its not displaying any error but not showing any image, instead a red border box.

ishan
  • 21
  • 5

1 Answers1

0

As it turns out in pods I had to add 'RCTImage' also to display image

pod 'React', :path => ‘node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTImage',
    'RCTNetwork',
    'BatchedBridge',
    'RCTWebSocket', # needed for debugging

'RCTAnimation'
    # Add any other subspecs you want to use in your project
]
ishan
  • 21
  • 5