Skip to content

Commit 3b313f4

Browse files
staltzcharpeni
andauthored
Use globalThis instead of global in auto.js (#413)
Co-authored-by: Nicolas Charpentier <[email protected]>
1 parent 3b0eebb commit 3b313f4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
module.exports = {
22
extends: '@react-native-community',
33
root: true,
4+
globals: {
5+
globalThis: false,
6+
},
47
};

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export * from './js/URL';
66
export * from './js/URLSearchParams';
77

88
export function setupURLPolyfill() {
9-
global.REACT_NATIVE_URL_POLYFILL = `${name}@${version}`;
9+
globalThis.REACT_NATIVE_URL_POLYFILL = `${name}@${version}`;
1010

11-
global.URL = require('./js/URL').URL;
12-
global.URLSearchParams = require('./js/URLSearchParams').URLSearchParams;
11+
globalThis.URL = require('./js/URL').URL;
12+
globalThis.URLSearchParams = require('./js/URLSearchParams').URLSearchParams;
1313
}

0 commit comments

Comments
 (0)