React hooks: are they useful for shared state management, like e.g. Redux?

No, hooks don't totally eliminate the need for Redux. Hooks are mainly as an alternative to implement features that we have to use classes for today:

  1. Local component state
  2. Context
  3. Lifecycle methods and side effects

Other than the above, hooks also provide an easier way to share stateful logic between components.

What is more likely to kill/replace Redux is context instead of hooks, which is a way to share state across components. But IMO context isn't as powerful as Redux stores as there are other features that Redux offers besides a shared state store such as middlewares and a specialized devtool with time-travelling capabilites. There's also a whole learning and tooling ecosystem built around Redux that context doesn't have at the moment as far as I know.

If you use the useReducer hook in conjunction with context like in this example, it'd be very similar to using Redux and for small apps (like a TodoMVC), it might be sufficient. For large apps I don't think just one context and useReducer will be sufficient. You might need multiple of them, and that's where using Redux and composing stores would make sense. You could also combine multiple contexts and useReducer hooks but it might be cleaner to just use Redux.


No, Hooks won't replace Redux, but they can help you write cleaner code, and you won't need to write class components just to use local state or lifecycle methods. That is a great use case right there.

In the past you had to use Redux to make sure a state is persistent between each re-render of the component. But now you can just use useState() method to implement a persistent local state! You can use useEffect() instead of React lifecycle methods, and you can use useReducer to write quick action creator methods and access a global state!!

Here is a good article about how to use useReducer() method.