Hi man, I was bit on the ege when I was writing that comment, sorry about that.
Thanks for the link I'll take a look, I was more dramatic then anything, personally don't have problems with useEffect, I just find it outrageous about the size of the article I mention.
non-basic cases are if you have to bring the response data into a global store (i.e. redux), or implement caching, or web sockets or other niche things like that.
This is how Dan Abramov suggests it's done in his article, in which you can observe the fetchData function is defined and invoked inside the useEffect. And the state setter function is called within the fetchData function.
That flavio copes article that theorizable linked to is far too simplistic to help, IMO.
0
u/[deleted] Jun 08 '21
[deleted]