How to Show Base64 Data as Image in React Native

Last Updated on October 16, 2018.

Showing Base64 encoded data as image is very easy in React Native. It is pretty similar to what you would do with the basic HTML.

All you need is to pass the Base64 data to the source prop of the image component.

const encodedBase64 = 'R0lGODlhAQABAIAAAAAA...7';
<Image source={{uri: `data:image/gif;base64,${encodedBase64}`}} />

 

Leave a Reply

%d bloggers like this: