DEV Community

Discussion on: Fetching data with React hooks and Axios

Collapse
 
victorocna profile image
Victor Ocnarescu

Cool example! One thing to add that I would find useful is a status returned from the custom hook instead of the loading boolean. This way the status can be success, error or loading and you can also handle Axios errors.

Cheers!

Collapse
 
darkmavis1980 profile image
Alessio Michelini

That's a really good idea, I just kept it simple for the sake of not writing too much code and just get the gist, but yeah, you are totally right