问题描述
我正在使用 Expo 并尝试使用 react-native-fetch-blob 下载文件
从'rn-fetch-blob'导入RNFetchBlob;RNFetchBlob.fetch('GET', 'http://www.example.com/images/img1.png').then((res) => {让状态 = res.info().status;}).catch((errorMessage, statusCode) => {})
发生错误:null 不是对象(正在评估'RNFetchBlob.DocumentDir')
我已经尝试过的:
npm install --save react-native-fetch-blob反应原生链接
npm install --save react-native-fetch-blobreact-native 链接 react-native-fetch-blob
var RNFetchBlob = require('rn-fetch-blob').default
RNFB_ANDROID_PERMISSIONS=true react-native 链接
我不能手动链接,因为我使用 expo 并且没有/ios 和/android 文件夹.
谁能帮忙,如何解决这个问题?rn-fetch-blob 是否与 Expo 合作?
rn-fetch-blob 不适用于 expo.
rn-fetch-blob 实现的是原生代码,所以不能在 expo 中使用基于项目.你需要退出世博会
I'm using Expo and try to download files using react-native-fetch-blob
import RNFetchBlob from 'rn-fetch-blob';
RNFetchBlob.fetch('GET', 'http://www.example.com/images/img1.png')
.then((res) => {
let status = res.info().status;
})
.catch((errorMessage, statusCode) => {
})
There is an error occurs: null is not an object (evaluating 'RNFetchBlob.DocumentDir')
What i've already tried:
npm install --save react-native-fetch-blob
react-native link
npm install --save react-native-fetch-blob
react-native link react-native-fetch-blob
var RNFetchBlob = require('rn-fetch-blob').default
RNFB_ANDROID_PERMISSIONS=true react-native link
I cannot do manually linking, because i use expo and do not have /ios and /android folders.
Could anyone help, how to fix this issue? Is rn-fetch-blob work with Expo?
rn-fetch-blob doesn't work with expo.
Does rn-fetch-blob work with Expo?
这篇关于Null 不是使用 Expo 的对象(评估“RNFetchBlob.DocumentDir")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!