Live data from Hacker News

Show HN: Tired of logic in useEffect, I built a class-based React state manager

thales.me

51–57 of 57 posts

Re: Show HN: Tired of logic in useEffect, I built a class-based React state manager

#51
post #16

The problems OP tries to address are unfortunately a deep design flaw in mainstream frameworks like React and Vue. This is due to 2 properties they have: 1. They marry view hierarchy to state hierarchy 2. They make it very ergonomic to put state in components I've been through this endless times. There are significant ways to reduce this friction, but in the end there's a tight ceiling. This is why this kind of work…

Vue provides a computed feature that acts as a buffer layer between the view and the state, so the view and the state are not necessarily strictly bound

Computed is only a concept because you need a band-aid for that lack of separation. You can read more about my efforts ditching Vue here:

https://blog.nestful.app/s/the-tech-behind-nestful

Re: Show HN: Tired of logic in useEffect, I built a class-based React state manager

#52

Earlier quoted context omitted.

Is it? I have never had any issues doing it this way.

This post explains it pretty well: https://dev.to/deveshsangwan/stop-using-useeffect-for-data-f...

I am not convinced. Have been using this pattern for years without issue.

Re: Show HN: Tired of logic in useEffect, I built a class-based React state manager

#53

Earlier quoted context omitted.

This post explains it pretty well: https://dev.to/deveshsangwan/stop-using-useeffect-for-data-f...

I am not convinced. Have been using this pattern for years without issue.

You can lead a horse to water...

Re: Show HN: Tired of logic in useEffect, I built a class-based React state manager

#54

Earlier quoted context omitted.

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.

Re: Show HN: Tired of logic in useEffect, I built a class-based React state manager

#55

Earlier quoted context omitted.

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.

Re: Show HN: Tired of logic in useEffect, I built a class-based React state manager

#56

Earlier quoted context omitted.

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.

It wasn't the owner that suggested it. It was some random blogplost that insisted the normal town well that everyone used was no good and you have to use his super special well instead. He points to an incident 6 months ago where someone got drunk and decided to jump into the well. The dude who jumped into the well didn't even say it was the well's fault.

I did read the article linked. I am remain unconvinced. Use effect for data fetching is not "risky", "fragile", and does not cause "subtle, hard to debug problems". This is baseless fear mongering. Claiming Tanstack is the "right" way is incredibly arrogant.

Post reply on HN