0

I am using Redux in the number of my React applications, and it is a good way to use Redux to manage application's state and making the state to be the "single source of truth".

But as in React 16.3, the new concept of Context API has introduced which also provides a way to share values/state like Redux Store between components without having to explicitly pass a prop through every level of the tree.

So, Is React Context API fully replacement or we can say alternative of Redux and will react-redux deprecated in the future?

Ashok Gujjar
  • 451
  • 4
  • 18
  • 1
    If you are looking for an easy alternative to Redux, then I would recommend "PullState", its very simple to use. Unlike context API it is a full fledged State Management system like Redux. – pauljeba Jun 21 '20 at 19:19

1 Answers1

1

Actually react-redux v6 is now using the new Context API!

redux gives you more features -> the capability of managing reducers, the dispatch function, middlewares, devtools and many more... Moreover reat-redux has some useful hidden features, like the capability to not re-render your component if the props of mapStateToProps has not changed.

So redux + react-redux will give your more power than Context Api, it depends of your needs.

By the way, it seems like react will progressively integrate redux in their api, they added the function useReducer in their future Hook API which is really similar to the redux api

Olivier Boissé
  • 9,568
  • 4
  • 27
  • 43