fix useeffect dependency

This commit is contained in:
Simone Taeggi 2022-11-22 15:58:37 +01:00
parent 0aa31064b2
commit 7c650d340c

View File

@ -8,13 +8,14 @@ const useFetchClient = () => {
// when unmount cancel the axios request
source.cancel();
};
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
// const options = {
// cancelToken: source.token,
// };
const options = {
cancelToken: source.token,
};
return getFetchClient();
return getFetchClient(options);
};
export default useFetchClient;