|
|
|
|
|
by qPkk4Bi
887 days ago
|
|
I assume your suggestion here is just to embrace a framework for data fetching and try not to think too hard about how they in turn implement it? Can't really fault developers for falling into this useEffect trap when even the official docs show that data fetching is indeed handled via useEffect[1], while at the same trying to yell at the reader to "NOT TRY THIS AT HOME" and just go use a framework because it's such a complex problem... which naturally just creates more questions than answers for the poor developer trying to understand how it all works. [1] https://react.dev/learn/you-might-not-need-an-effect#fetchin... |
|
There are so many things about syncing data between the client and the server that this section of the docs should just say "Don't", use Apollo or Redux or whetever. React is UI library, for data you need data library or at least general state handling library. Quick and dirty will bite you tenfold.