DEV Community

loading...

Discussion on: Why React projects still use Redux

Collapse
thiht profile image
Thibaut Rousseau

As of 2020 I keep reading everywhere that Redux should be used anymore, but I fail to find what to replace it with. The closest I found was someone who reimplemented Redux with useContext and useReducer, but to me it just feels like a doing a new worse Redux? (No proper logging, time travel, observables...)

Even Dan Abramov says he hates Redux but never suggests a proper way to replace it... Maybe it's because the global store is now considered a bad thing?

Collapse
alexandrudanpop profile image
Alexandru-Dan Pop Author

I think it's nice that the core React team is not suggesting something in particular. If they would have done this, it would have hurt the ecosystem for sure - as it would limit innovations and cool ideas. Redux aside, there are a ton of other very cool state management libraries like MobX, Recoil, Zustand, and many more.

Collapse
andrewbaisden profile image
Andrew Baisden

GraphQL is an option. Now while GraphQL is not a replacement for Redux it does help to reduce the need for using it.

Collapse
alexandrudanpop profile image
Alexandru-Dan Pop Author

If the APIs we are using are providing GraphQL then sure! I would not require an API team to build a GraphQL API only for a frontend application. There needs to be multiple consumers or higher business value for that GraphQL API, otherwise, we cannot justify the added complexity server-side.

Collapse
zarabotaet profile image
Dima

Give a try to Effector. Its framework agnostic tiny reactive library, wich come with selectors and thunks/sagas out of the box.
After a three year's of redux/mobx and some apollo, effector is just a breath of fresh air for me.🙂🙃

Collapse
alexandrudanpop profile image
Alexandru-Dan Pop Author

Thanks! I'll check it out when I get some time!