4 ms·
> Is Redux dead, dying, deprecated, or about to be replaced? No. Reading through the comments it sounds like it's struggling, even positing the question sews d
by tren-hard 7y ago
> Is Redux dead, dying, deprecated, or about to be replaced?
No.
Reading through the comments it sounds like it's struggling, even positing the question sews doubt. I thought redux was still one of the 'must have' tools for building react apps now.
What has everyone been migrating to? Is there a consensus successor to Redux?
- xwdv 7y agoNothing. The latest version of React has plenty of features now (such as hooks) that take the wind out of Redux’s sails.
- tmountain 7y agoIt depends on your use case, but he mentions some alternative solutions in the article. 1) React's Context API It's straightforward to use, and it solves the issue of passing data to deeply nested components, but that's all it does. 2) GraphQL Apollo Client I used this on a recent project for managing client-side state, and to me, it felt like I had to do a lot of work to achieve what should be basic functionality. It was my first foray with Apollo Client, so take my opinion with a grain of salt, but I found myself wishing I was using Redux instead for the duration of the project. Also, Apollo Client has some bugs related to cache invalidation (look on Github). These may be solved now, but they bit me pretty hard. 3) The new React "Hooks" API Looks nice. Have not used it.
- acemarke 7y agoThat's literally the point I'm making in the article. There's a huge difference between all the chatter on social media, and the actual stats reflecting Redux's usage. Two charts to illustrate this: First, overall downloads for React, Redux, React-Redux, MobX, and Apollo Client over the last two years: https://npm-stat.com/charts.html?package=react&package=redux&package=react-redux&package=mobx&package=apollo-client&from=2018-01-01&to=2020-04-04 https://npm-stat.com/charts.html?package=react&package=redux... You can see that net Redux usage overall has continued to increase, and is holding fairly steady at about 50% of React downloads. Second, for Redux Toolkit specifically, the growth rate from just before we released `redux-starter-kit@1.0`, then renamed it to `@reduxjs/toolkit@1.0.4`, through today: https://npm-stat.com/charts.html?package=%40reduxjs%2Ftoolkit&package=redux-starter-kit&from=2019-10-01&to=2020-04-09 https://npm-stat.com/charts.html?package=%40reduxjs%2Ftoolki... Obviously way fewer total downloads, but that's a steadily increasing growth rate for RTK. This is not something that's "struggling". There's just a lot of FUD thrown around on social media that makes it sound that way.