Hacker News new | ask | show | jobs
by acemarke 1682 days ago
Hi, I'm a Redux maintainer. React has always had "state management" built in in the form of component state: `this.setState` in class components, and `useState/useReducer` in function components. Those work just fine.

However, that _is_ limited in that you can only access state inside the current component, or pass it down the tree as props/context. If you need to access data broadly across the component tree, or the data itself does not lend itself to a tree-shaped usage pattern, or you need to minimize the number of components that re-render when you update, or you need to use it _outside_ the component tree, then you may want to look at an external state management library.

I've talked about the tradeoffs in these approaches numerous times:

https://blog.isquaredsoftware.com/2021/01/context-redux-diff...

https://changelog.com/posts/when-and-when-not-to-reach-for-r...

https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-...

All that said: React makes writing an application with any meaningful amount of complexity _vastly_ easier to do than trying to do it with either preceding UI frameworks (AngularJS 1.x, Backbone, etc) or jQuery. It isn't perfect, but it's well-suited for a wide range of application development use cases.