This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
Fetch Replacement evalues to object, not function #190
Closed
Description
RN version: 0.35
RNFetchBlob version: 0.10.0
Platform: Android & iOS
I tried using the fetch replacement functions as documented here:
https://github.com/wkh237/react-native-fetch-blob/wiki/Fetch-API#fetch-replacement
import RNFetchBlob from 'react-native-fetch-blob';
const Fetch = RNFetchBlob.polyfill.Fetch;
// replace built-in fetch
window.fetch = new Fetch({
// enable this option so that the response data conversion handled automatically
auto : true,
// when receiving response data, the module will match its Content-Type header
// with strings in this array. If it contains any one of string in this array,
// the response body will be considered as binary data and the data will stored
// in file system instead of in memory.
// By default, it only store response data to file system when Content-Type
// contains string `application/octet`.
binaryContentTypes : [
'image/',
'video/',
'audio/',
]
});
However, when I do this and use fetch()
, I get the following error:
fetch is not a function
TypeError: fetch is not a function
Logging the replacement fetch function yields the following:
console.log("RNfetchblob fetch: " , fetch);
The original fetch function looks like this:
Any help into solving this issue is greatly appreciated.