加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

react-native – RNFetchBlob需要主队列设置

发布时间:2020-12-15 09:34:01 所属栏目:百科 来源:网络整理
导读:将RNFetchBlob与React Native一起使用时,我会看到一个黄色警告屏幕: Module RNFetchBlob requires main queue setup since it overrides constantsToExport but doesn’t implement requiresMainQueueSetup . In a future release React Native will defaul
将RNFetchBlob与React Native一起使用时,我会看到一个黄色警告屏幕:

Module RNFetchBlob requires main queue setup since it overrides
constantsToExport but doesn’t implement requiresMainQueueSetup. In
a future release React Native will default to initializing all native
modules on a background thread unless explicitly opted-out of.

我使用react-native 0.56.0和react-native-fetch-blob:0.10.8.这在之前的反应原生0.54.2.

究竟是什么错误告诉我的?主队列设置究竟是什么?我该怎么做才能解决这个问题?谢谢!

解决方法

事实证明,不再支持react-native-fetch-blob,我需要使用rn-fetch-blob.要解决这个问题,我必须做以下事情:

> react-native unlink react-native-fetch-blob
> npm uninstall –save react-native-fetch-blob
> npm install –save rn-fetch-blob
> react-native链接

然后,我必须更改使用的所有行:

从’react-native-fetch-blob’导入RNFetchBlob;

至:

从’rn-fetch-blob’导入RNFetchBlob;

现在一切都按照应有的方式运作.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读