Hacker News new | ask | show | jobs
by chrisweekly 64 days ago
Yeah, fetching data from a server in useEffect is a widely acknowledged and documented antipattern.
2 comments

It's a widely documented anti-pattern, while also not giving a convenient alternative.
Is it? I have never had any issues doing it this way.
I am not convinced. Have been using this pattern for years without issue.
You can lead a horse to water...
I have been drinking water for years. You are trying to tell me water is an antipattern and I should drink gatorade instead. No thanks.
I'm doing no such thing. I'm alerting you to the fact that the owner of the well where you've been drinking has warned that it's not potable and suggested drinking the pure, filtered water instead.

Did you even read the article I linked? If not, please do. If you did read it, and still believe it makes no difference, I can't do anything more to help and will simply wish you good luck and have a nice day.