Hacker News new | ask | show | jobs
by agrippanux 1137 days ago
You may of not used React in the past few years, but setState fell out of favor a while ago with the release of the useState hook and Redux (which I agree is an abomination) isn't necessary for 95% (imo) cases, again thanks to hooks.

For bound variables you can use MobX or signals in Preact.

1 comments

How does something "fall out of favor" in React?

Is it deprecated?

The recommendation for React projects for the past few years has been to write everything using functional components vs the old class-based components. In function-based components, you can only use hooks so useState is that's why the parent comment is referring to.