Fix lint errors
This commit is contained in:
parent
cc0833f7ac
commit
a16765b27e
2 changed files with 3 additions and 4 deletions
|
@ -8,7 +8,6 @@ import {
|
||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@chakra-ui/popover";
|
} from "@chakra-ui/popover";
|
||||||
import { Tooltip } from "@chakra-ui/tooltip";
|
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import HangerSpinner from "./components/HangerSpinner";
|
import HangerSpinner from "./components/HangerSpinner";
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -227,7 +227,7 @@ export function usePageTitle(title, { skip = false } = {}) {
|
||||||
*
|
*
|
||||||
* Our limited API is designed to match the `use-http` library!
|
* 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
|
// 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!
|
// fetch non-binary data later, extend this and get something else from res!
|
||||||
if (responseType !== "arrayBuffer") {
|
if (responseType !== "arrayBuffer") {
|
||||||
|
@ -241,7 +241,7 @@ export function useFetch(url, { headers = {}, responseType }) {
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
let canceled = false;
|
let canceled = false;
|
||||||
|
|
||||||
fetch(url, { headers })
|
fetch(url, fetchOptions)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
if (canceled) {
|
if (canceled) {
|
||||||
return;
|
return;
|
||||||
|
@ -265,7 +265,7 @@ export function useFetch(url, { headers = {}, responseType }) {
|
||||||
return () => {
|
return () => {
|
||||||
canceled = true;
|
canceled = true;
|
||||||
};
|
};
|
||||||
}, [url]);
|
}, [url, fetchOptions]);
|
||||||
|
|
||||||
return { loading, error, data };
|
return { loading, error, data };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue