File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,11 @@ type RejectedRecord = {|
3232
3333type Record = PendingRecord | ResolvedRecord | RejectedRecord ;
3434
35+ declare var globalThis: any ;
36+
3537// TODO: this is a browser-only version. Add a separate Node entry point.
36- const nativeFetch = window . fetch ;
38+ const nativeFetch = ( typeof globalThis !== 'undefined' ? globalThis : window )
39+ . fetch ;
3740
3841function getRecordMap ( ) : Map < string , Record > {
3942 return unstable_getCacheForType ( createRecordMap ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ module.exports = {
1515 WeakSet : true ,
1616 Uint16Array : true ,
1717 Reflect : true ,
18+ globalThis : true ,
1819 // Vendor specific
1920 MSApp : true ,
2021 __REACT_DEVTOOLS_GLOBAL_HOOK__ : true ,
You can’t perform that action at this time.
0 commit comments