Skip to content

Commit

Permalink
fix: use globalThis.fetch in ctx.fetch utility (#1490)
Browse files Browse the repository at this point in the history
fix: change the `fetch` reference in useFetch function

Co-authored-by: Artem Zakharchenko <kettanaito@gmail.com>
  • Loading branch information
Toxiapo and kettanaito committed Dec 7, 2022
1 parent 37f4f94 commit 42cdbc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/context/fetch.ts
Expand Up @@ -8,7 +8,7 @@ const useFetch: (input: RequestInfo, init?: RequestInit) => Promise<Response> =
import('node-fetch').then(({ default: nodeFetch }) =>
(nodeFetch as unknown as typeof window.fetch)(input, init),
)
: window.fetch
: globalThis.fetch

export const augmentRequestInit = (requestInit: RequestInit): RequestInit => {
const headers = new Headers(requestInit.headers)
Expand Down

0 comments on commit 42cdbc7

Please sign in to comment.