【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
在项目文件node_modules找到 react-native/Libraries/Core/InitializeCore.js
找到之后在文件末尾添加以下代码:
global.XMLHttpRequest = global.originalXMLHttpRequest
? global.originalXMLHttpRequest
: global.XMLHttpRequest
global.FormData = global.originalFormData
? global.originalFormData
: global.FormData
fetch // Ensure to get the lazy property
if (window.__FETCH_SUPPORT__) {
// it's RNDebugger only to have
window.__FETCH_SUPPORT__.blob = false
} else {
/*
* Set __FETCH_SUPPORT__ to false is just work for `fetch`.
* If you're using another way you can just use the native Blob and remove the `else` statement
*/
global.Blob = global.originalBlob ? global.originalBlob : global.Blob
global.FileReader = global.originalFileReader
? global.originalFileReader
: global.FileReader
}
来源:oschina
链接:https://my.oschina.net/u/3398936/blog/3144868