Here is my fetcher and my application is becoming too bulky that i wouldn't want to be calling it in evvery component, how do i configure the fetcher to be accessible everywhere in my application.
const fetcher = (url) => axios.get(url).then((resp) => resp);
I also want to set a default baseURL for axios in my application so i wouldn't have to be using the full url everytime i'm trynna make a request, so i did
axios.defaults.baseURL= "https://dog.ceo/api/breeds/image/random"
in my App.js, but it doesn't work.
Is there a better way to achieve these two problems using SWR?