Skip to content

Commit 64afe63

Browse files
committed
fix(react-native): use globalThis.fetch explicitly instead of node-fetch
1 parent 5fcada5 commit 64afe63

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/client/fetch-react-native.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ const XMLHttpRequest = require('./xmlhttprequest.js')
22
const b4a = require('b4a')
33
/** @type {import('node-fetch')['default']} */
44
// @ts-ignore
5-
const fetch = require('node-fetch')
5+
const fetch = () => {
6+
return globalThis.fetch || require('node-fetch')
7+
}
68

79
/**
810
* @param {string} url

types/lib/client/fetch-react-native.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)