Should you add a state container to your app.. and if so, which should you choose?

Zachary Williams
1 min readNov 25, 2020

He was a skater boy. She said we need a state container, boy. He asked “why though? Are you sure this app is big enough to warrant adding another layer of complexity to our codebase? And if we’re going to do this, which one should we use?”

and there I was.. eavesdropping. Oh don’t look at me like that.. you know I love technical conversations.. and plus he had a point..

What do State Containers do?

It’s a fair question. We can handle state using react’s built-in hooks.. so why would we need a state container?

In large-scale applications we may have hundreds or even thousands of “encapsulated” components individually tracking data and changes to state. If that’s the case, and we are frequently updating state, or if our state updates are complex, or if there are many people updating state within the application..

Then we can use a state container as a place to store application state globally. We can also use a state container across the application as a way to build out a structured, consistent process for dealing with state & its changes.

Which state containers are there and which should I use?

Edit: I am in the process of updating this article. Check back soon (:

--

--

Zachary Williams

Frontend engineer, coffee enthusiast, & cat whisperer all rolled into one