From ba6d630cd9ae56c62c29df905a3ff87c1a7907c1 Mon Sep 17 00:00:00 2001 From: Kit Loong Date: Wed, 27 Dec 2023 21:31:32 +0800 Subject: [PATCH] Update axios configuration --- src/hooks/useSWRAxios.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hooks/useSWRAxios.ts b/src/hooks/useSWRAxios.ts index b541aed..8e5b3e9 100644 --- a/src/hooks/useSWRAxios.ts +++ b/src/hooks/useSWRAxios.ts @@ -1,6 +1,6 @@ import useSWR from 'swr' import axios, { - AxiosError, + AxiosError, AxiosHeaders, AxiosRequestConfig, AxiosResponse, AxiosResponseTransformer, @@ -26,7 +26,9 @@ export default function useSWRAxios( headers: {}, status: 200, statusText: 'Initial', - config: {}, + config: { + headers: new AxiosHeaders(), + }, } const fallbackData: AxiosResponse = { ...initFallbackData, ...axiosFallbackData }