React native 可能未处理的承诺拒绝(id:0):错误:不支持的输入文件类型
我在react native中使用文件堆栈上载图像并获取url作为响应,但我收到了此错误React native 可能未处理的承诺拒绝(id:0):错误:不支持的输入文件类型,react-native,filestack,React Native,Filestack,我在react native中使用文件堆栈上载图像并获取url作为响应,但我收到了此错误 如果您使用的是来自任何web链接(或任何api)的图像,则只需将图像sourceprop更改为source={{{uri:response.uri}}即可添加此选项 如果您使用的是本地映像,则必须使用source={require('some_image_path')} const ChooseImage=()=>{ let options = { title: 'Choose
如果您使用的是来自任何web链接(或任何api)的图像,则只需将图像
source
prop更改为source={{{uri:response.uri}}
即可添加此选项
如果您使用的是本地映像,则必须使用source={require('some_image_path')}
const ChooseImage=()=>{
let options = {
title: 'Choose an image',
storageOptions: {
skipBackup: true
}
};
launchImageLibrary(options, (response) => {
if (response.didCancel) {
// on cancel
} else {
const source = { uri: response.uri };
setAvatarSource(source)
Client.upload(response).then(data =>console.log(data));
}
});
}