diff --git a/types/react-native/globals.d.ts b/types/react-native/globals.d.ts index 613fd663be..7f27293b5b 100644 --- a/types/react-native/globals.d.ts +++ b/types/react-native/globals.d.ts @@ -31,6 +31,10 @@ declare interface GlobalFetch { declare function fetch(input: RequestInfo, init?: RequestInit): Promise; +declare interface WindowOrWorkerGlobalScope { + fetch(input: RequestInfo, init?: RequestInit): Promise; +} + interface Blob {} declare class FormData { diff --git a/types/react-native/test/globals.tsx b/types/react-native/test/globals.tsx index c2e3a2dcab..a2fdf241a5 100644 --- a/types/react-native/test/globals.tsx +++ b/types/react-native/test/globals.tsx @@ -1,4 +1,4 @@ -const fetchCopy: GlobalFetch["fetch"] = fetch; +const fetchCopy: WindowOrWorkerGlobalScope["fetch"] = fetch; const myHeaders = new Headers(); myHeaders.append("Content-Type", "image/jpeg");