From a16765b27e020a9d61c0029a5afcca164a05ef6a Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 23 Apr 2021 11:40:49 -0700 Subject: [PATCH] Fix lint errors --- src/app/SupportPetAppearancesPage.js | 1 - src/app/util.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/SupportPetAppearancesPage.js b/src/app/SupportPetAppearancesPage.js index 0202679..4bd713b 100644 --- a/src/app/SupportPetAppearancesPage.js +++ b/src/app/SupportPetAppearancesPage.js @@ -8,7 +8,6 @@ import { PopoverContent, PopoverTrigger, } from "@chakra-ui/popover"; -import { Tooltip } from "@chakra-ui/tooltip"; import { Link } from "react-router-dom"; import HangerSpinner from "./components/HangerSpinner"; import { diff --git a/src/app/util.js b/src/app/util.js index b02d0b0..712310e 100644 --- a/src/app/util.js +++ b/src/app/util.js @@ -227,7 +227,7 @@ export function usePageTitle(title, { skip = false } = {}) { * * Our limited API is designed to match the `use-http` library! */ -export function useFetch(url, { headers = {}, responseType }) { +export function useFetch(url, { responseType, ...fetchOptions }) { // Just trying to be clear about what you'll get back ^_^` If we want to // fetch non-binary data later, extend this and get something else from res! if (responseType !== "arrayBuffer") { @@ -241,7 +241,7 @@ export function useFetch(url, { headers = {}, responseType }) { React.useEffect(() => { let canceled = false; - fetch(url, { headers }) + fetch(url, fetchOptions) .then(async (res) => { if (canceled) { return; @@ -265,7 +265,7 @@ export function useFetch(url, { headers = {}, responseType }) { return () => { canceled = true; }; - }, [url]); + }, [url, fetchOptions]); return { loading, error, data }; }