How to Render Binary Data in Image in React Native?

Solution for How to Render Binary Data in Image in React Native?
is Given Below:

Help!!! I am currently struggling to render binary data as an image in react native. I am receiving an array of numbers from the backend, and I have no clue what to do with it in order to render it. I’m not sure if I need to convert it into base64, and if so, how to do it, or if I can simply display the raw binary data without base64 processing.

Any help would be much appreciated.

In order to use the binary data for image you should append this at the beginning of the data received: 'data:image/png;base64,'

So basically,

<Image style={{width: 100, height: 50}} source={{uri: `data:image/png;base64,${image.data}`}}/>

Please replace image.data with the binary data you are receiving.