Using react-native-camera, how to access saved pictures? : <p>My goal is to use the react-native-camera and simply show a picture on the same screen, if a picture has been taken. I'm trying to save the picture source as "imageURI". If it exists, I want to show it, if a picture hasn't been taken yet, just show text saying No Image Yet. I've got the camera working, since I can trace the app is saving pictures to the disk. Having trouble with the following: </p>

<ul>
<li>How to assign the capture functions data to a variable when I take the picture, that I can call later (imageURI).</li>
<li><p>Don't know how to do an if statement in Javascript to check if a variable exists yet.</p>

<pre><code>import Camera from 'react-native-camera';

export default class camerahere extends Component {

_takePicture () {
  this.camera.capture((err, data) =&gt; {
  if (err) return;
  imageURI = data;
  });
}

render() {

  if ( typeof imageURI == undefined) {
    image = &lt;Text&gt; No Image Yet &lt;/Text&gt; 
  } else {
    image = &lt;Image source={{uri: imageURI, isStatic:true}} 
    style={{width: 100, height: 100}} /&gt;
  }


return (
  &lt;View style={styles.container}&gt;
    &lt;Camera
      captureTarget={Camera.constants.CaptureTarget.disk}
      ref={(cam) =&gt; {
        this.camera = cam;
      }}
      style={styles.preview}
      aspect={Camera.constants.Aspect.fill}&gt;

      {button}
    &lt;TouchableHighlight onPress={this._takePicture.bind(this)}&gt;
      &lt;View style={{height:50,width:50,backgroundColor:"pink"}}&gt;&lt;/View&gt;
&lt;/TouchableHighlight&gt;
&lt;/Camera&gt;
</code></pre>

<p></p></li>
</ul>
