79314681

Date: 2024-12-28 22:55:02
Score: 0.5
Natty:
Report link

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.

Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): When you
  • Low reputation (0.5):
Posted by: johnhaup