DEV Community

loading...

Discussion on: the correct way to fetch data with react hooks

Collapse
nicomartin profile image
Nico Martin Author • Edited

Hi @mykel ,
Excellent question! In that case I think I would just move the loading logic into a new function that I can then return from the hook as well:
gist.github.com/nico-martin/24de58...

Collapse
mykel profile image
Michaël Fischer

Thanks for the answer.