HACKER Q&A
📣 WolfOliver

What to Learn in 2020: Redux vs. RxJS vs. Context-API


Starting a greenfield React app, is it still state-of-the art to use Redux as state manager. Will Redux still be around in 2 years or will it be replaced by simpler options? Any thoughts on that?


  👤 acemarke Accepted Answer ✓
Hi, I'm a Redux maintainer. I can confirm that Redux will be around for a very long time, and it's easier to use it now than ever before.

Please see my post "Redux - Not Dead Yet!" [0] for information on how Redux compares to other options like context in today's React ecosystem.

Also, note that you should be using our new official Redux Toolkit package [1] to write your Redux logic, our "Style Guide" docs page [2] provides guidance on recommended patterns and best practices, and our Redux templates for Create-React-App [3] come with RTK and React-Redux hooks set up out of the box.

[0] https://blog.isquaredsoftware.com/2018/03/redux-not-dead-yet...

[1] https://redux-toolkit.js.org

[2] https://redux.js.org/style-guide/style-guide

[3] https://github.com/reduxjs/cra-template-redux


👤 hknd
It's the same every year: learn and completely understand the basics - the rest will follow.

If you know how latest react works you don't need redux or rxjs as hooks can solve most problems in a reusable way.

Example: https://github.com/oldboyxx/jira_clone


👤 dexwiz
Redux will be around for a while due to the number of people who already use it, but may not be a first choice at some point.

RxJS is kind of equivalent to Promises + Utils. You can use it to structure code, but it won’t solve state issues on its own.

I don’t know enough context api to comment on it.