title: React Native - Convert base64 encoded image to URI
body: <p>I'm holding a list of objects that contains base64 encoded image data as a state, so I can show them to the user in a list component. Something like this:</p>
  <pre><code>[
      {
          id: &quot;23789373&quot;,
          address: &quot;92 West Sunnyslope Street Woodhaven, NY 11421&quot;,
          thumbnail: &quot;iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYA...&quot;,
      },
      {
          id: &quot;91501148&quot;,
          address: &quot;62 North St Severn, MD 21144&quot;,
          thumbnail: &quot;yblAAAAHElEQVQI12P4//8/w38GE0DHxljNB...&quot;,
      },
      //...
  ]
  </code></pre>
  <p>The thing is, it seems like base64 encoded data is way too long, so after having about 5 objects, the app starts to really slow down.</p>
  <p>I've found that someone having the same problem as mine on a React-Redux app wrote a <a href="https://medium.com/@gabriele.cimato/on-how-to-store-an-image-in-redux-d623bcc06ca7" rel="nofollow noreferrer">medium article</a>. She explains it like this:</p>
  <blockquote>
  <p>The overwhelming amount of data would clutter your state unnecessarily, all of this because you are storing the full base64 image in your store. While I was using this approach just to “get it done”, I soon realized that my debugging experience was getting out of hand. With the support of a co worker we started using this nice little thing called createObjectURL . What this does is create a DOMString containing a URL that references the image. This way in our store we could simply save this normal URL-like reference instead of a gigantic blob of data!</p>
  </blockquote>
  <p>Since there is no createObjectURL method in React Native, is there a way I can store the images in memory, and use the URI as the state?</p>