1

Actually i am using react-native image picker and there are different pages. So when i load a image in react-native image picker and navigate to different page and comeback to the same the image is no longer exist. I want that image which was loaded in image picker should be maintained

//this is how i am setting the state of photo

handleChoosePhoto = () => {
const options = {
  noData: true,
}
ImagePicker.showImagePicker(options, response => {
  console.log('Response = ', response);
  if (response.didCancel) {
    console.log('User cancelled image picker');
  } else if (response.error) {
    console.log('ImagePicker Error: ', response.error);
  } else {
    //let source = response;
    if (response.uri) {
      this.setState({ photo: response})
    }
  }

});
}


<Image
source={{ uri:this.state.photo.uri }}
style={styles.ImageIconStyle}/>
Ritesh Dange
  • 29
  • 1
  • 3

0 Answers0