title: Get recently clicked image from camera on image view in react-native
body: <p>I am implementing camera in my react native application. I want to show the recently captured image from that camera in a small image view on the same screen after click. But I am not getting how do I access the recently clicked  image. Whenever any new image is clicked through phone it has been given a default random name, how do I refer it in image view's source?Please suggest me some way to do that. My code is </p>
  
  <pre><code> class Incident extends Component {
      constructor(props)
      {  super(props)
  
          this.state=  {path:"",show:false,video:Camera.constants.CaptureMode.video,camera:Camera.constants.CaptureMode.camera}    
        }
      render() {
        return (
                &lt;View style={styles.container}&gt;
               &lt;View style={{flex:72}}&gt;
               &lt;Camera
                ref={(cam) =&gt; {
                 this.camera = cam;
                  }}
                style={styles.preview}
                 aspect={Camera.constants.Aspect.fill}
                captureMode={this.state.camera}&gt;
  
            &lt;/Camera&gt;
  
    &lt;/View&gt;
    &lt;View style={{flex:8,opacity:0.5,backgroundColor:'black'}}&gt;
  
      {()=&gt;this.showClickedImage()}
  
    &lt;/View&gt;
  
  
    &lt;View style={{flex:10,flexDirection:'row',justifyContent:'space-between',backgroundColor:'#f3396b'}}&gt;
    &lt;TouchableOpacity style={{flex:33,flexDirection:'column', alignItems: 'center',paddingTop:10}}&gt;
    &lt;Image style={styles.icon} source={require('./Images/menu.png')}/&gt;
    &lt;Text&gt;Home&lt;/Text&gt;
    &lt;/TouchableOpacity&gt;
  
  
  
    &lt;TouchableOpacity style={{flex:34,flexDirection:'column', height:70,alignItems: 'center',borderColor:'#dd1e52',borderWidth:1,paddingTop:5}} 
                                 onPress={()=&gt;this.takePicture()}&gt;
    &lt;Image style={{width:50,height:50}} source={require('./Images/capture.png')}/&gt;
  
    &lt;/TouchableOpacity&gt;
  
  
  
  
  
    &lt;TouchableOpacity style={{flex:33,flexDirection:'column', alignItems: 'center',paddingTop:10}}&gt;
    &lt;Image style={styles.icon} source={require('./Images/profile.png')}/&gt;
    &lt;Text&gt;Profile&lt;/Text&gt;
    &lt;/TouchableOpacity&gt;
  
  
    &lt;/View&gt;
    &lt;/View&gt;
  );
        }
  
        showClickedImage()
    { 
          return &lt;View style={{flex:1,height:40,width:40, borderWidth:1,borderColor:'black'}}&gt;
                 &lt;Image style={{width:40,height:40}} source= {{uri: this.state.path}}/&gt;
                 &lt;/View&gt;
                 }
  
         takePicture() 
       {
  
         this.camera.capture()
    .then((data) =&gt;{console.log(data.path),this.setState({show:true}),this.setState({path:data.path})})
    .catch(err =&gt; console.error(err));
               }
              }
  </code></pre>