Skip to content
This repository was archived by the owner on Aug 3, 2023. It is now read-only.

Commit eca89d5

Browse files
Jasper Meyerjamesplease
authored andcommitted
🐛 fixes globalObj being undefined in non-Node Environments like react-native
1 parent 0418745 commit eca89d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/fetch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,8 @@ export class Fetch extends React.Component {
420420
}
421421

422422
const globalObj = typeof self !== 'undefined' ? self : this;
423-
const AbortSignalCtr = globalObj.AbortSignal || function() {};
423+
const AbortSignalCtr =
424+
globalObj !== undefined ? globalObj.AbortSignal : function() {};
424425

425426
Fetch.propTypes = {
426427
children: PropTypes.func,

0 commit comments

Comments
 (0)