当前位置 : 主页 > 网页制作 > React >

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

来源:互联网 收集:自由互联 发布时间:2021-06-15
将RNFetchBlob与React Native一起使用时,我会看到一个黄色警告屏幕: Module RNFetchBlob requires main queue setup since it overrides constantsToExport but doesn’t implement requiresMainQueueSetup . In a future release Reac
将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;

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

网友评论