formData中的图像选择器响应在create react native中附加到多个数组中

时间:2018-12-06 10:31:03

标签: react-native expo

我正在尝试使用expo附加ImagePicker的响应。 这是我的相机功能:

getFirstMatchOrLast(Arrays.asList(1, 2, 3, 5), i -> i == 7).orElseThrow(...)
getFirstMatchOrLast(Arrays.asList(1, 2, 3, 5), i -> i == 7).orElse(0);
getFirstMatchOrLast(Arrays.asList(1, 2, 3, 5), i -> i == 7).orElseGet(() -> /* complex formula */);
getFirstMatchOrLast(stream::iterator, i -> i == 5).ifPresent(...)

这是我的句柄功能

  cameraUpload = async() => {
let pickerResult = await ImagePicker.launchCameraAsync({
  exif: true,
  allowsEditing: true,
  quality: 0.7,
  base64: false,
  aspect: [4, 3]
});
if (!pickerResult.cancelled) {
  this.handleUploadPhoto(pickerResult)
}}

响应被附加在formData()内,但是它被附加在数组内。我的控制台响应如下:

handleUploadPhoto(pickerResult){

let formData = new FormData();  
cropInfo = {
  width: 602,
  height: 602
},
contentType = "type/jpeg",
FileSystem.getInfoAsync(pickerResult.uri).then((info) => {
  formData.append({ "uri": info.uri  })
  console.log(formData)
})}

谁能告诉我为什么将我的响应附加到这些数组中?预先感谢。

0 个答案:

没有答案