I have read in the document here: https://github.com/mg365/react-native-customized-image-picker that I could get the response object of data from an image, but when I tried it I got undefined
. I can get other objects like size, mime, and path like this:
SelectPhoto = () =>{
ImagePicker.openPicker({
cropping: true,
title: 'Select a Picture',
isCamera: true,
}).then((imgResponse) => {
console.log(imgResponse[0].path); <-- This logs the correct path
console.log(imgResponse[0].data); <-- This logs the undefined
let imgSource = { uri: imgResponse[0].path };
this.setState({
userimgSource: imgSource,
});
});
}
My ultimate goal is to upload an image to a server and I think having the data is required? I am using the RNFetchBlob multipart/form-data. Any help on this is appreciated, thank you!