0

How do I pass markerPass.Logo__c which is a base64 string into my image component?

<Image source={{uri: 'data:image/png;base64,' + {markerPass.Logo__c} + '\''}}/>
S.B.
  • 437
  • 2
  • 6
  • 19

1 Answers1

2

You can do it using the Template Literals by using backtick ``

<Image source={{uri: `data:image/png;base64,${markerPass.Logo__c}\'`}}/>
Pritish Vaidya
  • 21,561
  • 3
  • 58
  • 76
  • 1
    Thanks! Side note for those completely clueless like me, it seems I also needed to add the style attribute for it to render (at least on Android). Added to image component: style={{width: 66, height: 58}} – S.B. Sep 08 '18 at 18:16