When you put it in the hook, you’re creating a new axios instance every time the hook rerenders, which isn’t good.
Your interceptors apply to the first instance only, since the useEffect
only runs on mount. Your hook always return the latest created instance. So if the hook renders more than once you’re out of luck.