Use React hooks to connect your Redux store and your components

Fernando Abolafio
The Startup
Published in
5 min readNov 20, 2019

--

Say goodbye to HOCs or connectors and welcome the React hooks era

Outline:

  • Can React hooks and Redux coexist?
  • TL;DR: Focus on the integration between your app state and the components
  • Connecting components using hooks
  • Conclusion

Can Rect hooks and Redux coexist?

I will say it, React hooks and Redux can and should coexist. Especially when you already have Redux holding your application state, there is no reason to drop it off and start from scratch just because you can write a reducer using hooks. Let redux do what it does best and instead, focus on the integration between your app state and the components.

Redux is great by managing state! You got middlewares such as redux-thunk, a damn good debugging tool for chrome, composition of reducers and thousands of articles about it around the web.

TL;DR: Focus on the integration between your app state and the components

--

--

Fernando Abolafio
The Startup

Programmer — Modeling Revenue in code @GrowblocksHQ — Writing about Web Dev/React/Remix/NextJs — Software Architecture