It is essentially what React Query does for you, which I would consider to look into vs Axios. That might reduce the boilerplate code considerably.
PS: The example would have been nice with a non-typescript version of the code, side-by-side. So we can see what headache came because of TypeScript vs. what came because of Axios.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Try extracting the data fetching into a custom hook, for reusability, like shown in here in Approach A: dev.to/suhanw/decouple-data-from-u...
It is essentially what React Query does for you, which I would consider to look into vs Axios. That might reduce the boilerplate code considerably.
PS: The example would have been nice with a non-typescript version of the code, side-by-side. So we can see what headache came because of TypeScript vs. what came because of Axios.